aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-10-02 02:46:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-10-02 02:46:56 +0200
commit0aaaa50b4551ab5912ccd95d66d633844eac6d85 (patch)
tree1a1f9e34c690051a678fb048064e4e98cca3536b /shell/hush_test
parent42eeb255c1c5f35373d3e7bfa892e4f864cf1266 (diff)
downloadbusybox-w32-0aaaa50b4551ab5912ccd95d66d633844eac6d85.tar.gz
busybox-w32-0aaaa50b4551ab5912ccd95d66d633844eac6d85.tar.bz2
busybox-w32-0aaaa50b4551ab5912ccd95d66d633844eac6d85.zip
ash: expand: Fixed "$@" expansion when EXP_FULL is false
Upstream commit: Date: Thu, 1 Jan 2015 07:53:10 +1100 expand: Fixed "$@" expansion when EXP_FULL is false The commit 3c06acdac0b1ba0e0acdda513a57ee6e31385dce ([EXPAND] Split unquoted $@/$* correctly when IFS is set but empty) broke the case where $@ is in quotes and EXP_FULL is false. In that case we should still emit IFS as field splitting is not performed. Reported-by: Juergen Daubert <jue@jue.li> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-vars/var_wordsplit_ifs1.right16
-rwxr-xr-xshell/hush_test/hush-vars/var_wordsplit_ifs1.tests21
2 files changed, 37 insertions, 0 deletions
diff --git a/shell/hush_test/hush-vars/var_wordsplit_ifs1.right b/shell/hush_test/hush-vars/var_wordsplit_ifs1.right
index efdafc70f..cf583d0aa 100644
--- a/shell/hush_test/hush-vars/var_wordsplit_ifs1.right
+++ b/shell/hush_test/hush-vars/var_wordsplit_ifs1.right
@@ -22,4 +22,20 @@ Testing: IFS="" "$*"
22Testing: IFS="" "$@" 22Testing: IFS="" "$@"
23.abc. 23.abc.
24.d e. 24.d e.
25Testing: !IFS v=$*
26v='abc d e'
27Testing: !IFS v=$@
28v='abc d e'
29Testing: !IFS v="$*"
30v='abc d e'
31Testing: !IFS v="$@"
32v='abc d e'
33Testing: IFS="" v=$*
34v='abcd e'
35Testing: IFS="" v=$@
36v='abcd e'
37Testing: IFS="" v="$*"
38v='abcd e'
39Testing: IFS="" v="$@"
40v='abcd e'
25Finished 41Finished
diff --git a/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests b/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests
index 532ab992e..a62afc6fd 100755
--- a/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests
+++ b/shell/hush_test/hush-vars/var_wordsplit_ifs1.tests
@@ -18,4 +18,25 @@ IFS=""; for a in "$*"; do echo ".$a."; done
18echo 'Testing: IFS="" "$@"' 18echo 'Testing: IFS="" "$@"'
19IFS=""; for a in "$@"; do echo ".$a."; done 19IFS=""; for a in "$@"; do echo ".$a."; done
20 20
21echo 'Testing: !IFS v=$*'
22unset IFS; v=$*; echo "v='$v'"
23echo 'Testing: !IFS v=$@'
24unset IFS; v=$@; echo "v='$v'"
25echo 'Testing: !IFS v="$*"'
26unset IFS; v="$*"; echo "v='$v'"
27echo 'Testing: !IFS v="$@"'
28unset IFS; v="$@"; echo "v='$v'"
29
30echo 'Testing: IFS="" v=$*'
31IFS=""; v=$*; echo "v='$v'"
32echo 'Testing: IFS="" v=$@'
33IFS=""; v=$@; echo "v='$v'"
34echo 'Testing: IFS="" v="$*"'
35IFS=""; v="$*"; echo "v='$v'"
36echo 'Testing: IFS="" v="$@"'
37IFS=""; v="$@"; echo "v='$v'"
38
39# Note: in IFS="" v=$@ and IFS="" v="$@" cases, bash produces "abc d e"
40# We produce "abcd e"
41
21echo Finished 42echo Finished