Subject: bug#32069: Man page description is wrong for -i

From: Matthew Jenkins <[email-masked]>
Date: Thu, 5 Jul 2018 19:30:15 -0500

[mjenkins@hulk ~]$ sed --version
sed (GNU sed) 4.5
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <[email-masked]>.

On Fedora 28.

In the man page the description for -i is as follows:
       -i[SUFFIX], --in-place[=SUFFIX]

              edit files in place (makes backup if SUFFIX supplied)

However the actual behavior is it's replacing the original with a copy
and not editing in place. This can cause confusion for why sed is
breaking hardlinks. Example:

[mjenkins@hulk test]$ touch banana
[mjenkins@hulk test]$ stat banana | grep Inode
Device: fd07h/64775d Inode: 8782051     Links: 1
[mjenkins@hulk test]$ sed -i '' banana
[mjenkins@hulk test]$ stat banana | grep Inode
Device: fd07h/64775d Inode: 8781989     Links: 1

I'm pretty sure replacing with the copy is intentional behavior, so
can the manual be updated to reflect this?

Thanks,
Matthew