diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-01 20:55:02 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-01 20:55:02 +0200 |
commit | 88ac97d02dfeb4d3bd9efda45ceb64608cfedd53 (patch) | |
tree | d6ce66f90972a00ff95f811bd10a34b89bb7ea6b /shell/ash_test | |
parent | c4d4380a0700542796887b2e6dbd41e9a7916997 (diff) | |
download | busybox-w32-88ac97d02dfeb4d3bd9efda45ceb64608cfedd53.tar.gz busybox-w32-88ac97d02dfeb4d3bd9efda45ceb64608cfedd53.tar.bz2 busybox-w32-88ac97d02dfeb4d3bd9efda45ceb64608cfedd53.zip |
ash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
Upstream patch:
Date: Wed, 8 Oct 2014 15:42:08 +0800
[EXPAND] Do not split quoted VSLENGTH and VSTRIM
Currently VSLENGTH and VSTRIM* are field-split even within quotes.
This is obviously wrong. This patch fixes that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-vars/var_wordsplit_ifs2.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_wordsplit_ifs2.tests | 13 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var_wordsplit_ifs3.right | 12 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_wordsplit_ifs3.tests | 5 |
4 files changed, 33 insertions, 0 deletions
diff --git a/shell/ash_test/ash-vars/var_wordsplit_ifs2.right b/shell/ash_test/ash-vars/var_wordsplit_ifs2.right new file mode 100644 index 000000000..c234193fe --- /dev/null +++ b/shell/ash_test/ash-vars/var_wordsplit_ifs2.right | |||
@@ -0,0 +1,3 @@ | |||
1 | Unquoted:<1> | ||
2 | Unquoted:<3> | ||
3 | Quoted:<123> | ||
diff --git a/shell/ash_test/ash-vars/var_wordsplit_ifs2.tests b/shell/ash_test/ash-vars/var_wordsplit_ifs2.tests new file mode 100755 index 000000000..47523549c --- /dev/null +++ b/shell/ash_test/ash-vars/var_wordsplit_ifs2.tests | |||
@@ -0,0 +1,13 @@ | |||
1 | # 123 chars long | ||
2 | a="\ | ||
3 | 01234567890123456789\ | ||
4 | 01234567890123456789\ | ||
5 | 01234567890123456789\ | ||
6 | 01234567890123456789\ | ||
7 | 01234567890123456789\ | ||
8 | 0123456789\ | ||
9 | 0123456789\ | ||
10 | 012" | ||
11 | |||
12 | IFS=2; for v in ${#a}; do echo Unquoted:"<$v>"; done | ||
13 | IFS=2; for v in "${#a}"; do echo Quoted:"<$v>"; done | ||
diff --git a/shell/ash_test/ash-vars/var_wordsplit_ifs3.right b/shell/ash_test/ash-vars/var_wordsplit_ifs3.right new file mode 100644 index 000000000..5ab72e1cd --- /dev/null +++ b/shell/ash_test/ash-vars/var_wordsplit_ifs3.right | |||
@@ -0,0 +1,12 @@ | |||
1 | Unquoted%:<q> | ||
2 | Unquoted%:<w> | ||
3 | Unquoted%:<e> | ||
4 | Unquoted%:<r> | ||
5 | Unquoted%:<t> | ||
6 | Unquoted#:<w> | ||
7 | Unquoted#:<e> | ||
8 | Unquoted#:<r> | ||
9 | Unquoted#:<t> | ||
10 | Unquoted#:<y> | ||
11 | Quoted%:<q w e r t > | ||
12 | Quoted#:< w e r t y> | ||
diff --git a/shell/ash_test/ash-vars/var_wordsplit_ifs3.tests b/shell/ash_test/ash-vars/var_wordsplit_ifs3.tests new file mode 100755 index 000000000..4aa65574a --- /dev/null +++ b/shell/ash_test/ash-vars/var_wordsplit_ifs3.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | a="q w e r t y" | ||
2 | for v in ${a%y}; do echo Unquoted%:"<$v>"; done | ||
3 | for v in ${a#q}; do echo Unquoted#:"<$v>"; done | ||
4 | for v in "${a%y}"; do echo Quoted%:"<$v>"; done | ||
5 | for v in "${a#q}"; do echo Quoted#:"<$v>"; done | ||