diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-25 20:54:25 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-25 20:54:25 +0200 |
commit | 13f20919b2477230063bb940396bef51b463d6df (patch) | |
tree | 0b5f9053840208d92d70a4f6fe13ef2a5cb50604 /shell/ash_test | |
parent | bcf47eaa1f13dfdcc4564ddb1e5aedce4b3ca2b2 (diff) | |
download | busybox-w32-13f20919b2477230063bb940396bef51b463d6df.tar.gz busybox-w32-13f20919b2477230063bb940396bef51b463d6df.tar.bz2 busybox-w32-13f20919b2477230063bb940396bef51b463d6df.zip |
ash: fix handling of NULs in $'abc\000def\x00asd'. Closes 9286
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-quoting/dollar_squote_bash2.right | 6 | ||||
-rwxr-xr-x | shell/ash_test/ash-quoting/dollar_squote_bash2.tests | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/shell/ash_test/ash-quoting/dollar_squote_bash2.right b/shell/ash_test/ash-quoting/dollar_squote_bash2.right new file mode 100644 index 000000000..f7a1731dd --- /dev/null +++ b/shell/ash_test/ash-quoting/dollar_squote_bash2.right | |||
@@ -0,0 +1,6 @@ | |||
1 | strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr | ||
2 | strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr | ||
3 | 80:\ | ||
4 | 81:\ | ||
5 | 82:\ | ||
6 | Done:0 | ||
diff --git a/shell/ash_test/ash-quoting/dollar_squote_bash2.tests b/shell/ash_test/ash-quoting/dollar_squote_bash2.tests new file mode 100755 index 000000000..449772813 --- /dev/null +++ b/shell/ash_test/ash-quoting/dollar_squote_bash2.tests | |||
@@ -0,0 +1,10 @@ | |||
1 | # Embedded NULs | ||
2 | echo $'str\x00'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr | ||
3 | echo $'str\000'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr | ||
4 | |||
5 | # The chars after '\' are hex 0x80,81,82... | ||
6 | echo 80:$'\' | ||
7 | echo 81:$'\' | ||
8 | echo 82:$'\' | ||
9 | |||
10 | echo Done:$? | ||