If one line in a file has length (including newline) of 2^31, then
applying sed -i to that file truncates it to size 0. I first
noticed it like this: Create a file with line of length 2^31-1
$ perl -le 'print "v"x(2**31-1)' > k
Then prepend a byte to that line:
$ sed -i 's/^/v/' k
Surprise! The file is empty.
* sed/utils.c (ck_getline): Declare "result" to be of type ssize_t,
rather than int, to match the return type of getline.
Upstream 81ce070727b225a1e23e5a48f775811c8a9e7366
by Jim Meyering <meyering@redhat.com>