Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* second is "" before "d", third is "" after "d".
* Second match is NOT replaced!
*/
- if (prev_match_empty || start != 0) {
+ if (prev_match_empty || start != 0 || start != end) {
dbg("inserting replacement at %d in '%s'", start, line);
do_subst_w_backrefs(line, sed_cmd->string);
} else {
"sed 's [^ .]* x g'" \
"x x.x\n" "" " a.b\n"
+testing "sed zero chars match/replace logic must not falsely trigger here" \
+ "sed 's/a/A/g'" \
+ "_AAA1AA\n" "" "_aaa1aa\n"
+
# testing "description" "commands" "result" "infile" "stdin"
exit $FAILCOUNT