ash: add test for issue with here document
authorRon Yorston <rmy@pobox.com>
Thu, 29 Oct 2015 11:29:59 +0000 (11:29 +0000)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 29 Oct 2015 18:12:03 +0000 (19:12 +0100)
This used to work but doesn't now:

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

foo "bar"

Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash_test/ash-heredoc/heredoc2.right [new file with mode: 0644]
shell/ash_test/ash-heredoc/heredoc2.tests [new file with mode: 0755]

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