Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* The match_count check is so not to break
* echo "hi" | busybox sed 's/^/!/g'
*/
- if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) {
+ if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count && *line) {
pipe_putc(*line++);
continue;
}
# substitutions
testing "sed -n" "sed -n -e s/foo/bar/ -e s/bar/baz/" "" "" "foo\n"
+testing "sed with empty match" "sed 's/z*//g'" "string\n" "" "string\n"
testing "sed s//p" "sed -e s/foo/bar/p -e s/bar/baz/p" "bar\nbaz\nbaz\n" \
"" "foo\n"
testing "sed -n s//p" "sed -ne s/abc/def/p" "def\n" "" "abc\n"