aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-12 15:05:39 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-12 15:05:39 +0200
commitacd5bc8f649fad335d80c5289512b404f08ac8e2 (patch)
tree56594a40d09e2032b7be039c3c1c567a3871dde1 /shell/hush_test
parent958581a8d9583da8b9df0b69123e0c3990f7b3ff (diff)
downloadbusybox-w32-acd5bc8f649fad335d80c5289512b404f08ac8e2.tar.gz
busybox-w32-acd5bc8f649fad335d80c5289512b404f08ac8e2.tar.bz2
busybox-w32-acd5bc8f649fad335d80c5289512b404f08ac8e2.zip
hush: fix handling of \" in quoted/unquoted `cmd`
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-misc/heredoc_backslash1.right8
-rwxr-xr-xshell/hush_test/hush-misc/heredoc_backslash1.tests8
-rw-r--r--shell/hush_test/hush-psubst/tick3.right2
-rwxr-xr-xshell/hush_test/hush-psubst/tick3.tests6
4 files changed, 21 insertions, 3 deletions
diff --git a/shell/hush_test/hush-misc/heredoc_backslash1.right b/shell/hush_test/hush-misc/heredoc_backslash1.right
index 2633908fb..6a6114821 100644
--- a/shell/hush_test/hush-misc/heredoc_backslash1.right
+++ b/shell/hush_test/hush-misc/heredoc_backslash1.right
@@ -5,6 +5,8 @@ a\\
5 b 5 b
6 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 6 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
7 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 7 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
8 123456 `echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-'`
9 123456 $(echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-')
8c\ 10c\
9 11
10Unquoted heredoc: 12Unquoted heredoc:
@@ -13,6 +15,8 @@ a\
13 b 15 b
14 123456 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?- 16 123456 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?-
15 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?- 17 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?-
18 123456 v-$a-\t-\-\"-\x-`-\--\z-\*-\?-
19 123456 v-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-
16cEOF2 20cEOF2
17 21
18Quoted -heredoc: 22Quoted -heredoc:
@@ -22,6 +26,8 @@ a\\
22b 26b
23 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 27 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
24-$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 28-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
29 123456 `echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-'`
30 123456 $(echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-')
25c\ 31c\
26 32
27Unquoted -heredoc: 33Unquoted -heredoc:
@@ -30,6 +36,8 @@ a\
30b 36b
31 123456 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?- 37 123456 -qwerty-\t-\-\"-\'-`-\--\z-\*-\?-
32-qwerty-\t-\-\"-\'-`-\--\z-\*-\?- 38-qwerty-\t-\-\"-\'-`-\--\z-\*-\?-
39 123456 v-$a-\t-\-\"-\x-`-\--\z-\*-\?-
40 123456 v-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-
33cEOF4 41cEOF4
34 42
35Done: 0 43Done: 0
diff --git a/shell/hush_test/hush-misc/heredoc_backslash1.tests b/shell/hush_test/hush-misc/heredoc_backslash1.tests
index 22045d42e..501af5490 100755
--- a/shell/hush_test/hush-misc/heredoc_backslash1.tests
+++ b/shell/hush_test/hush-misc/heredoc_backslash1.tests
@@ -11,6 +11,8 @@ a\\
11 b 11 b
12 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 12 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
13 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 13 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
14 123456 `echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-'`
15 123456 $(echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-')
14c\ 16c\
15EOF1 17EOF1
16echo 18echo
@@ -23,6 +25,8 @@ a\\
23 b 25 b
24 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 26 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
25 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 27 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
28 123456 `echo v'-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-'`
29 123456 $(echo v'-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-')
26c\ 30c\
27EOF2 31EOF2
28EOF2 32EOF2
@@ -36,6 +40,8 @@ a\\
36 b 40 b
37 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 41 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
38 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 42 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
43 123456 `echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-'`
44 123456 $(echo v'-$a-\t-\\-\"-\'-\`-\--\z-\*-\?-')
39c\ 45c\
40 EOF3 46 EOF3
41# In -heredoc case the marker is detected even if it is indented. 47# In -heredoc case the marker is detected even if it is indented.
@@ -49,6 +55,8 @@ a\\
49 b 55 b
50 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 56 123456 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
51 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?- 57 -$a-\t-\\-\"-\'-\`-\--\z-\*-\?-
58 123456 `echo v'-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-'`
59 123456 $(echo v'-$a-\t-\\-\"-\x-\`-\--\z-\*-\?-')
52c\ 60c\
53EOF4 61EOF4
54 EOF4 62 EOF4
diff --git a/shell/hush_test/hush-psubst/tick3.right b/shell/hush_test/hush-psubst/tick3.right
index dc84e9263..00f267ae5 100644
--- a/shell/hush_test/hush-psubst/tick3.right
+++ b/shell/hush_test/hush-psubst/tick3.right
@@ -2,5 +2,5 @@
2$TEST 2$TEST
3Q 3Q
4a\bc 4a\bc
5a"c 511-$a-\t-\-\"-`-\--\z-\*-\?-22 33-$a-\t-\-"-`-\--\z-\*-\?-44
6done:0 6done:0
diff --git a/shell/hush_test/hush-psubst/tick3.tests b/shell/hush_test/hush-psubst/tick3.tests
index 469c43c27..3aeb241c3 100755
--- a/shell/hush_test/hush-psubst/tick3.tests
+++ b/shell/hush_test/hush-psubst/tick3.tests
@@ -7,6 +7,8 @@ echo `echo '\'TEST\`echo ZZ\`BEST`
7echo `echo \\$TEST` 7echo `echo \\$TEST`
8echo `echo \$TEST` 8echo `echo \$TEST`
9echo a`echo \\\\b`c 9echo a`echo \\\\b`c
10# \" etc are NOT special (passed verbatim WITH \)! 10
11echo a`echo \"`c 11# \" is not special if in unquoted `cmd` (passed verbatim WITH \),
12# but is special in quoted one
13echo `echo 11'-$a-\t-\\-\"-\`-\--\z-\*-\?-'22` "`echo 33'-$a-\t-\\-\"-\`-\--\z-\*-\?-'44`"
12echo done:$? 14echo done:$?