mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
sed: fix bug 623 (SEGV on some sed commands)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d75295c80b
commit
11c8238d1b
@ -690,10 +690,8 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
|
|||||||
if (sed_cmd->which_match)
|
if (sed_cmd->which_match)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (*line == '\0')
|
|
||||||
break;
|
|
||||||
//maybe (G.regmatch[0].rm_eo ? REG_NOTBOL : 0) instead of unconditional REG_NOTBOL?
|
//maybe (G.regmatch[0].rm_eo ? REG_NOTBOL : 0) instead of unconditional REG_NOTBOL?
|
||||||
} while (regexec(current_regex, line, 10, G.regmatch, REG_NOTBOL) != REG_NOMATCH);
|
} while (*line && regexec(current_regex, line, 10, G.regmatch, REG_NOTBOL) != REG_NOMATCH);
|
||||||
|
|
||||||
/* Copy rest of string into output pipeline */
|
/* Copy rest of string into output pipeline */
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user