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/hush_test/hush-quoting/squote_in_varexp1.right | 3 +++ shell/hush_test/hush-quoting/squote_in_varexp1.tests | 4 ++++ shell/hush_test/hush-quoting/squote_in_varexp2.right | 3 +++ shell/hush_test/hush-quoting/squote_in_varexp2.tests | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 shell/hush_test/hush-quoting/squote_in_varexp1.right create mode 100755 shell/hush_test/hush-quoting/squote_in_varexp1.tests create mode 100644 shell/hush_test/hush-quoting/squote_in_varexp2.right create mode 100755 shell/hush_test/hush-quoting/squote_in_varexp2.tests (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-quoting/squote_in_varexp1.right b/shell/hush_test/hush-quoting/squote_in_varexp1.right new file mode 100644 index 000000000..9d0add3c5 --- /dev/null +++ b/shell/hush_test/hush-quoting/squote_in_varexp1.right @@ -0,0 +1,3 @@ +Nothing: +Nothing: +Ok:0 diff --git a/shell/hush_test/hush-quoting/squote_in_varexp1.tests b/shell/hush_test/hush-quoting/squote_in_varexp1.tests new file mode 100755 index 000000000..efb380db3 --- /dev/null +++ b/shell/hush_test/hush-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/hush_test/hush-quoting/squote_in_varexp2.right b/shell/hush_test/hush-quoting/squote_in_varexp2.right new file mode 100644 index 000000000..9d0add3c5 --- /dev/null +++ b/shell/hush_test/hush-quoting/squote_in_varexp2.right @@ -0,0 +1,3 @@ +Nothing: +Nothing: +Ok:0 diff --git a/shell/hush_test/hush-quoting/squote_in_varexp2.tests b/shell/hush_test/hush-quoting/squote_in_varexp2.tests new file mode 100755 index 000000000..806ad12b9 --- /dev/null +++ b/shell/hush_test/hush-quoting/squote_in_varexp2.tests @@ -0,0 +1,4 @@ +x='\\\\' +printf Nothing:'%s\n' ${x#'\\\\'} +printf Nothing:'%s\n' "${x#'\\\\'}" +echo Ok:$? -- cgit v1.2.3