Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'editors/sed.c')
-rw-r--r--editors/sed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 02a527b4a..32a4b61f6 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -355,7 +355,10 @@ static int parse_regex_delim(const char *cmdstr, char **match, char **replace)
/* save the replacement string */
cmdstr_ptr += idx + 1;
idx = index_of_next_unescaped_regexp_delim(- (int)delimiter, cmdstr_ptr);
- *replace = copy_parsing_escapes(cmdstr_ptr, idx, 0);
+//GNU sed 4.8:
+// echo 789 | sed 's&8&\&&' - 7&9 ("\&" remained "\&")
+// echo 789 | sed 's1\(8\)1\1\11' - 7119 ("\1\1" become "11")
+ *replace = copy_parsing_escapes(cmdstr_ptr, idx, delimiter != '&' ? delimiter : 0);
return ((cmdstr_ptr - cmdstr) + idx);
}