From 13f20919b2477230063bb940396bef51b463d6df Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 25 Sep 2016 20:54:25 +0200 Subject: ash: fix handling of NULs in $'abc\000def\x00asd'. Closes 9286 Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-quoting/dollar_squote_bash2.right | 6 ++++++ shell/ash_test/ash-quoting/dollar_squote_bash2.tests | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 shell/ash_test/ash-quoting/dollar_squote_bash2.right create mode 100755 shell/ash_test/ash-quoting/dollar_squote_bash2.tests (limited to 'shell/ash_test/ash-quoting') 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 @@ +strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr +strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr +80:\ +81:\ +82:\ +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 @@ +# Embedded NULs +echo $'str\x00'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr +echo $'str\000'strstrstrstrstrstrstrstrstrstrstrstrstrstrstrstr + +# The chars after '\' are hex 0x80,81,82... +echo 80:$'\' +echo 81:$'\' +echo 82:$'\' + +echo Done:$? -- cgit v1.2.3