diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-04-24 19:21:16 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-04-24 19:21:16 +0200 |
commit | e39afe1fbd6d9f1ad1eea0052a5163572e11a98f (patch) | |
tree | f319e14175f80f51127f9d3bb168f556d7604a5b /editors/sed.c | |
parent | 3a9365e2732f5df2cdef758bc1f6e5e9da8fbcef (diff) | |
download | busybox-w32-e39afe1fbd6d9f1ad1eea0052a5163572e11a98f.tar.gz busybox-w32-e39afe1fbd6d9f1ad1eea0052a5163572e11a98f.tar.bz2 busybox-w32-e39afe1fbd6d9f1ad1eea0052a5163572e11a98f.zip |
sed: fix handling of s/// which has empty matches
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/sed.c')
-rw-r--r-- | editors/sed.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c index 4e9babb9d..429c1ed58 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -741,7 +741,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line_p) | |||
741 | * The match_count check is so not to break | 741 | * The match_count check is so not to break |
742 | * echo "hi" | busybox sed 's/^/!/g' | 742 | * echo "hi" | busybox sed 's/^/!/g' |
743 | */ | 743 | */ |
744 | if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) { | 744 | if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count && *line) { |
745 | pipe_putc(*line++); | 745 | pipe_putc(*line++); |
746 | continue; | 746 | continue; |
747 | } | 747 | } |