aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
-rw-r--r--shell/ash_test/ash-heredoc/heredoc_and_cmd.right2
-rwxr-xr-xshell/ash_test/ash-heredoc/heredoc_and_cmd.tests8
-rw-r--r--shell/hush_test/hush-heredoc/heredoc_and_cmd.right2
-rwxr-xr-xshell/hush_test/hush-heredoc/heredoc_and_cmd.tests8
5 files changed, 22 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index d29de37b7..c731a333b 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7028,6 +7028,7 @@ varunset(const char *end, const char *var, const char *umsg, int varflags)
7028 msg = umsg; 7028 msg = umsg;
7029 } 7029 }
7030 } 7030 }
7031 ifsfree();
7031 ash_msg_and_raise_error("%.*s: %s%s", (int)(end - var - 1), var, msg, tail); 7032 ash_msg_and_raise_error("%.*s: %s%s", (int)(end - var - 1), var, msg, tail);
7032} 7033}
7033 7034
@@ -7453,6 +7454,7 @@ varvalue(char *name, int varflags, int flags, int quoted)
7453 if (discard) 7454 if (discard)
7454 return -1; 7455 return -1;
7455 7456
7457 ifsfree();
7456 raise_error_syntax("bad substitution"); 7458 raise_error_syntax("bad substitution");
7457 } 7459 }
7458 7460
diff --git a/shell/ash_test/ash-heredoc/heredoc_and_cmd.right b/shell/ash_test/ash-heredoc/heredoc_and_cmd.right
new file mode 100644
index 000000000..25ae70561
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_and_cmd.right
@@ -0,0 +1,2 @@
1./heredoc_and_cmd.tests: line 4: D: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2Y
diff --git a/shell/ash_test/ash-heredoc/heredoc_and_cmd.tests b/shell/ash_test/ash-heredoc/heredoc_and_cmd.tests
new file mode 100755
index 000000000..197542de7
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_and_cmd.tests
@@ -0,0 +1,8 @@
1# The bug was only happening with <<REDIR;CMD form below:
2M='AAAAAAAAAAAAAAAAA'
3fff(){
4date <<000; echo Y
5${D?$M$M$M$M$M$M}
6000
7}
8fff
diff --git a/shell/hush_test/hush-heredoc/heredoc_and_cmd.right b/shell/hush_test/hush-heredoc/heredoc_and_cmd.right
new file mode 100644
index 000000000..5c19a0621
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_and_cmd.right
@@ -0,0 +1,2 @@
1hush: D: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2Y
diff --git a/shell/hush_test/hush-heredoc/heredoc_and_cmd.tests b/shell/hush_test/hush-heredoc/heredoc_and_cmd.tests
new file mode 100755
index 000000000..197542de7
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_and_cmd.tests
@@ -0,0 +1,8 @@
1# The bug was only happening with <<REDIR;CMD form below:
2M='AAAAAAAAAAAAAAAAA'
3fff(){
4date <<000; echo Y
5${D?$M$M$M$M$M$M}
6000
7}
8fff