[git commit] ash: add test for issue with here document

Denys Vlasenko vda.linux at googlemail.com
Thu Oct 29 18:12:03 UTC 2015


commit: http://git.busybox.net/busybox/commit/?id=9121510dc659baf6664456796c195460468c850b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

This used to work but doesn't now:

foo () {
cat <<EOF && { echo "$1" ; }
$1
EOF
}

foo "bar"

Reported-by: Natanael Copa <ncopa at alpinelinux.org>
Signed-off-by: Ron Yorston <rmy at pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash_test/ash-heredoc/heredoc2.right |    2 ++
 shell/ash_test/ash-heredoc/heredoc2.tests |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/shell/ash_test/ash-heredoc/heredoc2.right b/shell/ash_test/ash-heredoc/heredoc2.right
new file mode 100644
index 0000000..a486f1a
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.right
@@ -0,0 +1,2 @@
+bar
+bar
diff --git a/shell/ash_test/ash-heredoc/heredoc2.tests b/shell/ash_test/ash-heredoc/heredoc2.tests
new file mode 100755
index 0000000..6d9ccb6
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc2.tests
@@ -0,0 +1,7 @@
+foo () {
+cat <<EOF && { echo "$1" ; }
+$1
+EOF
+}
+
+foo "bar"


More information about the busybox-cvs mailing list