projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d75295c
)
sed: fix bug 623 (SEGV on some sed commands)
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 22 Sep 2009 01:02:21 +0000
(
03:02
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 22 Sep 2009 01:02:21 +0000
(
03:02
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/sed.c
patch
|
blob
|
history
diff --git
a/editors/sed.c
b/editors/sed.c
index b74941944e7e904d36c6c527d6213e3dbe91be72..e7b2c214af2e34d7a64351cfb624a68a2189b07c 100644
(file)
--- a/
editors/sed.c
+++ b/
editors/sed.c
@@
-690,10
+690,8
@@
static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
if (sed_cmd->which_match)
break;
- if (*line == '\0')
- break;
//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 */
while (1) {