From b2a79b1be70dce681cf997fa3e9cb19fe346e925 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 29 Aug 2011 10:28:20 +0200 Subject: [PATCH] fix help text for -i 2011-08-29 Paolo Bonzini * sed/sed.c (usage): Fix documentation for -i. Reported by Dennis Bartlett. --- ChangeLog | 11 ++++++++--- sed/sed.c | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e888a8c..54c45d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,14 @@ +2011-08-29 Paolo Bonzini + + * sed/sed.c (usage): Fix documentation for -i. Reported by + Dennis Bartlett. + 2011-07-11 Jim Meyering - avoid silent data loss when an input line is 231 bytes or longer - If one line in a file has length (including newline) of 231, then + avoid silent data loss when an input line is 2^31 bytes or longer + 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 231-1 + 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 diff --git a/sed/sed.c b/sed/sed.c index f8b497e..db7bb11 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -140,7 +140,7 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\ follow symlinks when processing in place\n")); #endif fprintf(out, _(" -i[SUFFIX], --in-place[=SUFFIX]\n\ - edit files in place (makes backup if extension supplied)\n")); + edit files in place (makes backup if SUFFIX supplied)\n")); #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__) fprintf(out, _(" -b, --binary\n\ open files in binary mode (CR+LFs are not processed specially)\n"));