diff options
author | Denys Vlasenko | 2022-01-23 18:48:49 +0100 |
---|---|---|
committer | Denys Vlasenko | 2022-01-23 18:48:49 +0100 |
commit | e998c7c032458a05a7afcc13ce0dc980b99ecc6c (patch) | |
tree | d3e7e3bf11d99237339d37b9a4eca95e67d62e5f /testsuite | |
parent | 33a9f34df5c53d3dd074a2168ff40d612a36667a (diff) | |
download | busybox-e998c7c032458a05a7afcc13ce0dc980b99ecc6c.zip busybox-e998c7c032458a05a7afcc13ce0dc980b99ecc6c.tar.gz |
sed: fix handling of escaped delimiters in s/// search pattern, closes 14541
function old new delta
copy_parsing_escapes 67 96 +29
parse_regex_delim 109 111 +2
get_address 213 215 +2
add_cmd 1176 1178 +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 35/0) Total: 35 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/sed.tests | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index e62b839..440996a 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests @@ -324,6 +324,16 @@ testing "sed zero chars match/replace logic must not falsely trigger here 2" \ "sed 's/ *$/_/g'" \ "qwerty_\n" "" "qwerty\n" +# the pattern here is interpreted as "9+", not as "9\+" +testing "sed special char as s/// delimiter, in pattern" \ + "sed 's+9\++X+'" \ + "X8=17\n" "" "9+8=17\n" + +# but in replacement string, "\&" remains "\&", not interpreted as "&" +testing "sed special char as s/// delimiter, in replacement" \ + "sed 's&9&X\&&'" \ + "X&+8=17\n" "" "9+8=17\n" + testing "sed /\$_in_regex/ should not match newlines, only end-of-line" \ "sed ': testcont; /\\\\$/{ =; N; b testcont }'" \ "\ |