diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-02-26 16:26:15 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-02-26 16:27:53 +0100 |
commit | c5a1be25ba6dd705382ce6c25d96a32f79974c04 (patch) | |
tree | 48b92a1b07b47329a2d48867ee5b7c11a84bea4a /shell/ash_test | |
parent | f873c63085e3f3745040286999779077ccc03987 (diff) | |
download | busybox-w32-c5a1be25ba6dd705382ce6c25d96a32f79974c04.tar.gz busybox-w32-c5a1be25ba6dd705382ce6c25d96a32f79974c04.tar.bz2 busybox-w32-c5a1be25ba6dd705382ce6c25d96a32f79974c04.zip |
ash: fix handling of single-quoted strings in pattern substitution
function old new delta
subevalvar 1576 1588 +12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-quoting/dollar_repl_bash2.right | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-quoting/dollar_repl_bash2.tests | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/shell/ash_test/ash-quoting/dollar_repl_bash2.right b/shell/ash_test/ash-quoting/dollar_repl_bash2.right new file mode 100644 index 000000000..e3fcd5807 --- /dev/null +++ b/shell/ash_test/ash-quoting/dollar_repl_bash2.right | |||
@@ -0,0 +1,4 @@ | |||
1 | axxb | ||
2 | axxb | ||
3 | axxb | ||
4 | axxb | ||
diff --git a/shell/ash_test/ash-quoting/dollar_repl_bash2.tests b/shell/ash_test/ash-quoting/dollar_repl_bash2.tests new file mode 100755 index 000000000..45c7a10e2 --- /dev/null +++ b/shell/ash_test/ash-quoting/dollar_repl_bash2.tests | |||
@@ -0,0 +1,8 @@ | |||
1 | v="x/x" | ||
2 | # The second / is quoted, should not be treated as separator | ||
3 | echo a${v/'/'}b | ||
4 | # The second / is escaped, should not be treated as separator | ||
5 | echo a${v/\/}b | ||
6 | |||
7 | echo "a${v/'/'}b" | ||
8 | echo "a${v/\/}b" | ||