sed: fix c cmd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -1031,7 +1031,7 @@ static void process_files(void)
|
|||||||
case 'c':
|
case 'c':
|
||||||
/* Only triggers on last line of a matching range. */
|
/* Only triggers on last line of a matching range. */
|
||||||
if (!sed_cmd->in_match)
|
if (!sed_cmd->in_match)
|
||||||
sed_puts(sed_cmd->string, NO_EOL_CHAR);
|
sed_puts(sed_cmd->string, '\n');
|
||||||
goto discard_line;
|
goto discard_line;
|
||||||
|
|
||||||
/* Read file, append contents to output */
|
/* Read file, append contents to output */
|
||||||
|
|||||||
@@ -248,4 +248,9 @@ testing "sed beginning (^) matches only once" \
|
|||||||
">/usr</>lib<\n" "" \
|
">/usr</>lib<\n" "" \
|
||||||
"/usr/lib\n"
|
"/usr/lib\n"
|
||||||
|
|
||||||
|
testing "sed c" \
|
||||||
|
"sed 'crepl'" \
|
||||||
|
"repl\nrepl\n" "" \
|
||||||
|
"first\nsecond\n"
|
||||||
|
|
||||||
exit $FAILCOUNT
|
exit $FAILCOUNT
|
||||||
|
|||||||
Reference in New Issue
Block a user