aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-22 06:20:26 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-22 06:20:26 +0200
commite85248afa23434b78e48fe09b57eea5f6657410d (patch)
tree8e4ddbead7f630a6cf3f5e224fb05952818b76a2 /shell/hush_test
parent8a33679694b0fdf459d69868f85c081cab5687cb (diff)
downloadbusybox-w32-e85248afa23434b78e48fe09b57eea5f6657410d.tar.gz
busybox-w32-e85248afa23434b78e48fe09b57eea5f6657410d.tar.bz2
busybox-w32-e85248afa23434b78e48fe09b57eea5f6657410d.zip
hush: fix segfault in ${?:N:M}
function old new delta expand_vars_to_list 2374 2409 +35 builtin_umask 132 133 +1 builtin_exit 47 48 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-vars/param_expand_alt.right2
-rwxr-xr-xshell/hush_test/hush-vars/param_expand_alt.tests4
-rw-r--r--shell/hush_test/hush-vars/param_expand_bash_substring.right13
-rwxr-xr-xshell/hush_test/hush-vars/param_expand_bash_substring.tests15
4 files changed, 31 insertions, 3 deletions
diff --git a/shell/hush_test/hush-vars/param_expand_alt.right b/shell/hush_test/hush-vars/param_expand_alt.right
index 4d2197a5e..67f18d69c 100644
--- a/shell/hush_test/hush-vars/param_expand_alt.right
+++ b/shell/hush_test/hush-vars/param_expand_alt.right
@@ -1,6 +1,6 @@
1hush: syntax error: unterminated ${name} 1hush: syntax error: unterminated ${name}
2hush: syntax error: unterminated ${name} 2hush: syntax error: unterminated ${name}
3_0 _0 3__ __
4_ _ _ _ _ 4_ _ _ _ _
5_aaaa _ _ _word _word 5_aaaa _ _ _word _word
6_ _ _ _ _ 6_ _ _ _ _
diff --git a/shell/hush_test/hush-vars/param_expand_alt.tests b/shell/hush_test/hush-vars/param_expand_alt.tests
index dcdca86d4..3b646b142 100755
--- a/shell/hush_test/hush-vars/param_expand_alt.tests
+++ b/shell/hush_test/hush-vars/param_expand_alt.tests
@@ -2,8 +2,8 @@
2"$THIS_SH" -c 'echo ${+} ; echo moo' 2"$THIS_SH" -c 'echo ${+} ; echo moo'
3"$THIS_SH" -c 'echo ${:+} ; echo moo' 3"$THIS_SH" -c 'echo ${:+} ; echo moo'
4 4
5# now some funky ones 5# now some funky ones. (bash doesn't accept ${#+})
6echo _${#+} _${#:+} 6echo _${#+}_ _${#:+}_
7 7
8# now some valid ones 8# now some valid ones
9set -- 9set --
diff --git a/shell/hush_test/hush-vars/param_expand_bash_substring.right b/shell/hush_test/hush-vars/param_expand_bash_substring.right
index 53b8836ff..2f4c51d06 100644
--- a/shell/hush_test/hush-vars/param_expand_bash_substring.right
+++ b/shell/hush_test/hush-vars/param_expand_bash_substring.right
@@ -39,6 +39,19 @@ f:1:2=|12|
39f::2 =|01| 39f::2 =|01|
40f:1: =|| 40f:1: =||
41f:: =|| 41f:: =||
42Substrings from special vars
43? =|0|
44?:1 =||
45?:1:2=||
46?::2 =|0|
47?:1: =||
48?:: =||
49# =|11|
50#:1 =|1|
51#:1:2=|1|
52#::2 =|11|
53#:1: =||
54#:: =||
42Substrings with expressions 55Substrings with expressions
43f =|01234567| 56f =|01234567|
44f:1+1:2+2 =|2345| 57f:1+1:2+2 =|2345|
diff --git a/shell/hush_test/hush-vars/param_expand_bash_substring.tests b/shell/hush_test/hush-vars/param_expand_bash_substring.tests
index a80523add..5c9552dba 100755
--- a/shell/hush_test/hush-vars/param_expand_bash_substring.tests
+++ b/shell/hush_test/hush-vars/param_expand_bash_substring.tests
@@ -55,6 +55,21 @@ f=0123456789; echo "f::2 =|${f::2}|"
55f=0123456789; echo "f:1: =|${f:1:}|" 55f=0123456789; echo "f:1: =|${f:1:}|"
56f=0123456789; echo "f:: =|${f::}|" 56f=0123456789; echo "f:: =|${f::}|"
57 57
58echo "Substrings from special vars"
59echo '? '"=|$?|"
60echo '?:1 '"=|${?:1}|"
61echo '?:1:2'"=|${?:1:2}|"
62echo '?::2 '"=|${?::2}|"
63echo '?:1: '"=|${?:1:}|"
64echo '?:: '"=|${?::}|"
65set -- 1 2 3 4 5 6 7 8 9 10 11
66echo '# '"=|$#|"
67echo '#:1 '"=|${#:1}|"
68echo '#:1:2'"=|${#:1:2}|"
69echo '#::2 '"=|${#::2}|"
70echo '#:1: '"=|${#:1:}|"
71echo '#:: '"=|${#::}|"
72
58echo "Substrings with expressions" 73echo "Substrings with expressions"
59f=01234567; echo 'f '"=|$f|" 74f=01234567; echo 'f '"=|$f|"
60f=01234567; echo 'f:1+1:2+2 '"=|${f:1+1:2+2}|" 75f=01234567; echo 'f:1+1:2+2 '"=|${f:1+1:2+2}|"