aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-06-07 16:34:57 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-06-07 16:34:57 +0200
commit84406e459be31b89de5a3d822f205d61c4c5855b (patch)
tree0a7cea9477a581761c694c9668a28e334da2ceef /editors
parentc35545a100c08d26d49fd1c2ca10e56e6650c5c1 (diff)
downloadbusybox-w32-84406e459be31b89de5a3d822f205d61c4c5855b.tar.gz
busybox-w32-84406e459be31b89de5a3d822f205d61c4c5855b.tar.bz2
busybox-w32-84406e459be31b89de5a3d822f205d61c4c5855b.zip
sed: fix breakage added by zero length match code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/sed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 85c84665b..0fe82f337 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -767,7 +767,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p)
767 * second is "" before "d", third is "" after "d". 767 * second is "" before "d", third is "" after "d".
768 * Second match is NOT replaced! 768 * Second match is NOT replaced!
769 */ 769 */
770 if (prev_match_empty || start != 0) { 770 if (prev_match_empty || start != 0 || start != end) {
771 dbg("inserting replacement at %d in '%s'", start, line); 771 dbg("inserting replacement at %d in '%s'", start, line);
772 do_subst_w_backrefs(line, sed_cmd->string); 772 do_subst_w_backrefs(line, sed_cmd->string);
773 } else { 773 } else {