summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko2018-02-13 14:43:29 +0100
committerDenys Vlasenko2018-02-13 14:44:11 +0100
commit8de5b9f88ba9fe2f203abab9ca7d85129c3eb679 (patch)
treeddadeda2afcfaa0560fc697bbb5d884ee0363ec0 /shell/hush_test
parent3459024bf404af814cacfe90a0deb719e282ae62 (diff)
downloadbusybox-8de5b9f88ba9fe2f203abab9ca7d85129c3eb679.zip
busybox-8de5b9f88ba9fe2f203abab9ca7d85129c3eb679.tar.gz
ash : fix double-quoted "\z" handling
function old new delta readtoken1 2602 2608 +6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-quoting/bkslash_case1.right10
-rwxr-xr-xshell/hush_test/hush-quoting/bkslash_case1.tests38
2 files changed, 48 insertions, 0 deletions
diff --git a/shell/hush_test/hush-quoting/bkslash_case1.right b/shell/hush_test/hush-quoting/bkslash_case1.right
new file mode 100644
index 0000000..1b52491
--- /dev/null
+++ b/shell/hush_test/hush-quoting/bkslash_case1.right
@@ -0,0 +1,10 @@
+ok1
+ok2
+ok3
+ok4
+ok5
+Ok:0
+ok6
+ok7
+ok8
+Ok:0
diff --git a/shell/hush_test/hush-quoting/bkslash_case1.tests b/shell/hush_test/hush-quoting/bkslash_case1.tests
new file mode 100755
index 0000000..d0c3599
--- /dev/null
+++ b/shell/hush_test/hush-quoting/bkslash_case1.tests
@@ -0,0 +1,38 @@
+# Case argument is globbed, match patterns are not.
+# This caught some bugs in the past.
+
+case z in
+\z ) echo ok1 ;;
+* ) echo BUG ;;
+esac
+case \z in
+z ) echo ok2 ;;
+* ) echo BUG ;;
+esac
+case \z in
+\z ) echo ok3 ;;
+* ) echo BUG ;;
+esac
+case z in
+\z ) echo ok4 ;;
+* ) echo BUG ;;
+esac
+case \\z in
+\\z ) echo ok5 ;;
+* ) echo BUG ;;
+esac
+echo Ok:$?
+
+case "\z" in
+"\z" ) echo ok6 ;;
+* ) echo BUG ;;
+esac
+case "\\z" in
+"\\z" ) echo ok7 ;;
+* ) echo BUG ;;
+esac
+case "\\\z" in
+"\\\z") echo ok8 ;;
+* ) echo BUG ;;
+esac
+echo Ok:$?