aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-03-02 20:48:36 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-03-02 20:48:36 +0100
commitd4802c6243e64e28690577bc0bb4f030581c496b (patch)
treee1b3785c46bd4361419fb22718b319cf3a835658 /shell/hush_test
parent55f8133a4fb207d6fecd02f43c36809d3c2f6672 (diff)
downloadbusybox-d4802c6243e64e28690577bc0bb4f030581c496b.tar.gz
hush: fix a='a\\'; echo "${a%\\\\}"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-quoting/squote_in_varexp1.right3
-rwxr-xr-xshell/hush_test/hush-quoting/squote_in_varexp1.tests4
-rw-r--r--shell/hush_test/hush-quoting/squote_in_varexp2.right3
-rwxr-xr-xshell/hush_test/hush-quoting/squote_in_varexp2.tests4
4 files changed, 14 insertions, 0 deletions
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:$?