summaryrefslogtreecommitdiffstats
path: root/package/busybox/busybox-1.15.1-sed.patch
blob: 7042bf0ebeec1f248ed2aae36e39075094ebf4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff -urpN busybox-1.15.1/editors/sed.c busybox-1.15.1-sed/editors/sed.c
--- busybox-1.15.1/editors/sed.c	2009-09-12 17:55:58.000000000 +0200
+++ busybox-1.15.1-sed/editors/sed.c	2009-09-22 03:01:59.000000000 +0200
@@ -690,10 +690,8 @@ static int do_subst_command(sed_cmd_t *s
 		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) {