ash: add test for issue with here document
authorRon Yorston <rmy@pobox.com>
Thu, 29 Oct 2015 11:29:59 +0000 (11:29 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 22 Mar 2016 22:21:06 +0000 (18:21 -0400)
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>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
(cherry picked from commit 9121510dc659baf6664456796c195460468c850b)

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"