aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-04-19 22:36:07 -0400
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-19 22:36:07 -0400
commit96a18332316568ebccaa186ffb519b48c4310714 (patch)
tree3c3219e8642aa41902d1b1c5d04c2bf71ab5866e
parentc175c4664734e5a363d8cc8668c08f551eff1485 (diff)
downloadbusybox-w32-96a18332316568ebccaa186ffb519b48c4310714.tar.gz
busybox-w32-96a18332316568ebccaa186ffb519b48c4310714.tar.bz2
busybox-w32-96a18332316568ebccaa186ffb519b48c4310714.zip
sed: fix c cmd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/sed.c2
-rwxr-xr-xtestsuite/sed.tests5
2 files changed, 6 insertions, 1 deletions
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)
1031 case 'c': 1031 case 'c':
1032 /* Only triggers on last line of a matching range. */ 1032 /* Only triggers on last line of a matching range. */
1033 if (!sed_cmd->in_match) 1033 if (!sed_cmd->in_match)
1034 sed_puts(sed_cmd->string, NO_EOL_CHAR); 1034 sed_puts(sed_cmd->string, '\n');
1035 goto discard_line; 1035 goto discard_line;
1036 1036
1037 /* Read file, append contents to output */ 1037 /* 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" \
248 ">/usr</>lib<\n" "" \ 248 ">/usr</>lib<\n" "" \
249 "/usr/lib\n" 249 "/usr/lib\n"
250 250
251testing "sed c" \
252 "sed 'crepl'" \
253 "repl\nrepl\n" "" \
254 "first\nsecond\n"
255
251exit $FAILCOUNT 256exit $FAILCOUNT