From d4802c6243e64e28690577bc0bb4f030581c496b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 2 Mar 2018 20:48:36 +0100 Subject: hush: fix a='a\\'; echo "${a%\\\\}" Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-quoting/squote_in_varexp1.right | 3 +++ shell/ash_test/ash-quoting/squote_in_varexp1.tests | 4 ++++ shell/ash_test/ash-quoting/squote_in_varexp2.right | 3 +++ shell/ash_test/ash-quoting/squote_in_varexp2.tests | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 shell/ash_test/ash-quoting/squote_in_varexp1.right create mode 100755 shell/ash_test/ash-quoting/squote_in_varexp1.tests create mode 100644 shell/ash_test/ash-quoting/squote_in_varexp2.right create mode 100755 shell/ash_test/ash-quoting/squote_in_varexp2.tests (limited to 'shell/ash_test') diff --git a/shell/ash_test/ash-quoting/squote_in_varexp1.right b/shell/ash_test/ash-quoting/squote_in_varexp1.right new file mode 100644 index 0000000..9d0add3 --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp1.right @@ -0,0 +1,3 @@ +Nothing: +Nothing: +Ok:0 diff --git a/shell/ash_test/ash-quoting/squote_in_varexp1.tests b/shell/ash_test/ash-quoting/squote_in_varexp1.tests new file mode 100755 index 0000000..efb380d --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp1.tests @@ -0,0 +1,4 @@ +x='\\\\' +printf Nothing:'%s\n' ${x#\\\\\\\\} +printf Nothing:'%s\n' "${x#\\\\\\\\}" +echo Ok:$? diff --git a/shell/ash_test/ash-quoting/squote_in_varexp2.right b/shell/ash_test/ash-quoting/squote_in_varexp2.right new file mode 100644 index 0000000..9d0add3 --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp2.right @@ -0,0 +1,3 @@ +Nothing: +Nothing: +Ok:0 diff --git a/shell/ash_test/ash-quoting/squote_in_varexp2.tests b/shell/ash_test/ash-quoting/squote_in_varexp2.tests new file mode 100755 index 0000000..806ad12 --- /dev/null +++ b/shell/ash_test/ash-quoting/squote_in_varexp2.tests @@ -0,0 +1,4 @@ +x='\\\\' +printf Nothing:'%s\n' ${x#'\\\\'} +printf Nothing:'%s\n' "${x#'\\\\'}" +echo Ok:$? -- cgit v1.1