From: Denys Vlasenko Date: Tue, 20 Apr 2010 02:36:07 +0000 (-0400) Subject: sed: fix c cmd X-Git-Tag: 1_17_0~279 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=96a18332316568ebccaa186ffb519b48c4310714;p=oweals%2Fbusybox.git sed: fix c cmd Signed-off-by: Denys Vlasenko --- diff --git a/editors/sed.c b/editors/sed.c index e5e187725..302a15605 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -1031,7 +1031,7 @@ static void process_files(void) case 'c': /* Only triggers on last line of a matching range. */ if (!sed_cmd->in_match) - sed_puts(sed_cmd->string, NO_EOL_CHAR); + sed_puts(sed_cmd->string, '\n'); goto discard_line; /* Read file, append contents to output */ diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 875c946be..f88524d07 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests @@ -248,4 +248,9 @@ testing "sed beginning (^) matches only once" \ ">/usrlib<\n" "" \ "/usr/lib\n" +testing "sed c" \ + "sed 'crepl'" \ + "repl\nrepl\n" "" \ + "first\nsecond\n" + exit $FAILCOUNT