aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-22 03:02:21 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-22 03:02:21 +0200
commit11c8238d1b0f72dffb2be563069ba5acca075f8e (patch)
tree3e2591852a0d0565d25aff6f9fb45360509ad425
parentd75295c80bcfa577b124328f09e75ea15facf67f (diff)
downloadbusybox-w32-11c8238d1b0f72dffb2be563069ba5acca075f8e.tar.gz
busybox-w32-11c8238d1b0f72dffb2be563069ba5acca075f8e.tar.bz2
busybox-w32-11c8238d1b0f72dffb2be563069ba5acca075f8e.zip
sed: fix bug 623 (SEGV on some sed commands)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/sed.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/editors/sed.c b/editors/sed.c
index b74941944..e7b2c214a 100644
--- 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)
690 if (sed_cmd->which_match) 690 if (sed_cmd->which_match)
691 break; 691 break;
692 692
693 if (*line == '\0')
694 break;
695//maybe (G.regmatch[0].rm_eo ? REG_NOTBOL : 0) instead of unconditional REG_NOTBOL? 693//maybe (G.regmatch[0].rm_eo ? REG_NOTBOL : 0) instead of unconditional REG_NOTBOL?
696 } while (regexec(current_regex, line, 10, G.regmatch, REG_NOTBOL) != REG_NOMATCH); 694 } while (*line && regexec(current_regex, line, 10, G.regmatch, REG_NOTBOL) != REG_NOMATCH);
697 695
698 /* Copy rest of string into output pipeline */ 696 /* Copy rest of string into output pipeline */
699 while (1) { 697 while (1) {