diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-09 02:06:57 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-06-09 02:06:57 +0200 |
commit | f451b2cfe042e3029b73261758b9ab7e956eaa03 (patch) | |
tree | 9e9ac2a6c3eab61e993eafb8299bf0b5694a8b2a /shell/ash_test | |
parent | 37ca36a71114a6fc5303d33cabc311cd8b9bf19a (diff) | |
download | busybox-w32-f451b2cfe042e3029b73261758b9ab7e956eaa03.tar.gz busybox-w32-f451b2cfe042e3029b73261758b9ab7e956eaa03.tar.bz2 busybox-w32-f451b2cfe042e3029b73261758b9ab7e956eaa03.zip |
ash: fix a bug in >${varexp} handling. Closes 5282
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-redir/redirA.right | 2 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redirA.tests | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/shell/ash_test/ash-redir/redirA.right b/shell/ash_test/ash-redir/redirA.right new file mode 100644 index 000000000..31406e336 --- /dev/null +++ b/shell/ash_test/ash-redir/redirA.right | |||
@@ -0,0 +1,2 @@ | |||
1 | tmp11 | ||
2 | tmp11 | ||
diff --git a/shell/ash_test/ash-redir/redirA.tests b/shell/ash_test/ash-redir/redirA.tests new file mode 100755 index 000000000..56833f938 --- /dev/null +++ b/shell/ash_test/ash-redir/redirA.tests | |||
@@ -0,0 +1,11 @@ | |||
1 | x="tmp11:tmp22" | ||
2 | |||
3 | # Bug was incorrectly expanding variables in >redir | ||
4 | echo "${x%:*}" >"${x%:*}" | ||
5 | echo tmp1* | ||
6 | rm tmp1* | ||
7 | |||
8 | # Also try unquoted | ||
9 | echo "${x%:*}" >${x%:*} | ||
10 | echo tmp1* | ||
11 | rm tmp1* | ||