diff options
author | Denys Vlasenko | 2010-04-19 22:36:07 -0400 |
---|---|---|
committer | Denys Vlasenko | 2010-04-19 22:36:07 -0400 |
commit | 96a18332316568ebccaa186ffb519b48c4310714 (patch) | |
tree | 3c3219e8642aa41902d1b1c5d04c2bf71ab5866e | |
parent | c175c4664734e5a363d8cc8668c08f551eff1485 (diff) | |
download | busybox-96a18332316568ebccaa186ffb519b48c4310714.zip busybox-96a18332316568ebccaa186ffb519b48c4310714.tar.gz |
sed: fix c cmd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/sed.c | 2 | ||||
-rwxr-xr-x | testsuite/sed.tests | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c index e5e1877..302a156 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 875c946..f88524d 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests @@ -248,4 +248,9 @@ testing "sed beginning (^) matches only once" \ ">/usr</>lib<\n" "" \ "/usr/lib\n" +testing "sed c" \ + "sed 'crepl'" \ + "repl\nrepl\n" "" \ + "first\nsecond\n" + exit $FAILCOUNT |