diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-12 15:05:39 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-09-12 15:05:39 +0200 |
commit | acd5bc8f649fad335d80c5289512b404f08ac8e2 (patch) | |
tree | 56594a40d09e2032b7be039c3c1c567a3871dde1 /shell/hush_test/hush-misc | |
parent | 958581a8d9583da8b9df0b69123e0c3990f7b3ff (diff) | |
download | busybox-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/hush-misc')
-rw-r--r-- | shell/hush_test/hush-misc/heredoc_backslash1.right | 8 | ||||
-rwxr-xr-x | shell/hush_test/hush-misc/heredoc_backslash1.tests | 8 |
2 files changed, 16 insertions, 0 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-\*-\?-') | ||
8 | c\ | 10 | c\ |
9 | 11 | ||
10 | Unquoted heredoc: | 12 | Unquoted 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-\*-\?- | ||
16 | cEOF2 | 20 | cEOF2 |
17 | 21 | ||
18 | Quoted -heredoc: | 22 | Quoted -heredoc: |
@@ -22,6 +26,8 @@ a\\ | |||
22 | b | 26 | b |
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-\*-\?-') | ||
25 | c\ | 31 | c\ |
26 | 32 | ||
27 | Unquoted -heredoc: | 33 | Unquoted -heredoc: |
@@ -30,6 +36,8 @@ a\ | |||
30 | b | 36 | b |
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-\*-\?- | ||
33 | cEOF4 | 41 | cEOF4 |
34 | 42 | ||
35 | Done: 0 | 43 | Done: 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-\*-\?-') | ||
14 | c\ | 16 | c\ |
15 | EOF1 | 17 | EOF1 |
16 | echo | 18 | echo |
@@ -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-\*-\?-') | ||
26 | c\ | 30 | c\ |
27 | EOF2 | 31 | EOF2 |
28 | EOF2 | 32 | EOF2 |
@@ -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-\*-\?-') | ||
39 | c\ | 45 | c\ |
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-\*-\?-') | ||
52 | c\ | 60 | c\ |
53 | EOF4 | 61 | EOF4 |
54 | EOF4 | 62 | EOF4 |