summaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
authorDenys Vlasenko2012-06-09 02:06:57 +0200
committerDenys Vlasenko2012-06-09 02:06:57 +0200
commitf451b2cfe042e3029b73261758b9ab7e956eaa03 (patch)
tree9e9ac2a6c3eab61e993eafb8299bf0b5694a8b2a /shell/ash_test
parent37ca36a71114a6fc5303d33cabc311cd8b9bf19a (diff)
downloadbusybox-f451b2cfe042e3029b73261758b9ab7e956eaa03.zip
busybox-f451b2cfe042e3029b73261758b9ab7e956eaa03.tar.gz
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.right2
-rwxr-xr-xshell/ash_test/ash-redir/redirA.tests11
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 0000000..31406e3
--- /dev/null
+++ b/shell/ash_test/ash-redir/redirA.right
@@ -0,0 +1,2 @@
+tmp11
+tmp11
diff --git a/shell/ash_test/ash-redir/redirA.tests b/shell/ash_test/ash-redir/redirA.tests
new file mode 100755
index 0000000..56833f9
--- /dev/null
+++ b/shell/ash_test/ash-redir/redirA.tests
@@ -0,0 +1,11 @@
+x="tmp11:tmp22"
+
+# Bug was incorrectly expanding variables in >redir
+echo "${x%:*}" >"${x%:*}"
+echo tmp1*
+rm tmp1*
+
+# Also try unquoted
+echo "${x%:*}" >${x%:*}
+echo tmp1*
+rm tmp1*