Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* The match_count check is so not to break
* echo "hi" | busybox sed 's/^/!/g'
*/
- if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count && *line) {
+ if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) {
pipe_putc(*line++);
- continue;
+ goto next;
}
match_count++;
) {
for (i = 0; i < G.regmatch[0].rm_eo; i++)
pipe_putc(*line++);
- continue;
+ goto next;
}
/* print everything before the match */
/* if we're not doing this globally, get out now */
if (sed_cmd->which_match != 0)
break;
-
+ next:
if (*line == '\0')
break;