aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2025-08-12 08:07:00 +0100
committerRon Yorston <rmy@pobox.com>2025-08-12 08:07:00 +0100
commit4e6b0b3e8b8f819bc9e2f69b0c267abecfe30968 (patch)
treed030cd6daff8d3b79f1fbefa0b33bd02f33c3d5c /shell
parentaa6a7ebcfb93b21916ad5fb97ecf64c22328c07b (diff)
parent628a7b2f4708037056a1432d7b6b1792c67e486a (diff)
downloadbusybox-w32-4e6b0b3e8b8f819bc9e2f69b0c267abecfe30968.tar.gz
busybox-w32-4e6b0b3e8b8f819bc9e2f69b0c267abecfe30968.tar.bz2
busybox-w32-4e6b0b3e8b8f819bc9e2f69b0c267abecfe30968.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
-rw-r--r--shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.right1
-rwxr-xr-xshell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.tests2
-rw-r--r--shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.right1
-rwxr-xr-xshell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.tests2
5 files changed, 11 insertions, 0 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 0b2bc01f5..d1f687f9d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -4625,6 +4625,11 @@ static int fetch_heredocs(o_string *as_string, struct pipe *pi, int heredoc_cnt,
4625 4625
4626 redir->rd_type = REDIRECT_HEREDOC2; 4626 redir->rd_type = REDIRECT_HEREDOC2;
4627 /* redir->rd_dup is (ab)used to indicate <<- */ 4627 /* redir->rd_dup is (ab)used to indicate <<- */
4628 if (!redir->rd_filename) {
4629 /* examples: "echo <<", "echo <<<", "echo <<>" */
4630 syntax_error("missing here document terminator");
4631 return -1;
4632 }
4628 p = fetch_till_str(as_string, input, 4633 p = fetch_till_str(as_string, input,
4629 redir->rd_filename, redir->rd_dup); 4634 redir->rd_filename, redir->rd_dup);
4630 if (!p) { 4635 if (!p) {
diff --git a/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.right b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.right
new file mode 100644
index 000000000..7af73557a
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.right
@@ -0,0 +1 @@
hush: syntax error: missing here document terminator
diff --git a/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.tests b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.tests
new file mode 100755
index 000000000..33ccde26b
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF1.tests
@@ -0,0 +1,2 @@
1echo <<
2echo Done:
diff --git a/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.right b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.right
new file mode 100644
index 000000000..7af73557a
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.right
@@ -0,0 +1 @@
hush: syntax error: missing here document terminator
diff --git a/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.tests b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.tests
new file mode 100755
index 000000000..fcda11045
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_syntax_err_no_EOF2.tests
@@ -0,0 +1,2 @@
1echo << >
2echo Done: