aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c2
-rw-r--r--shell/ash_test/ash-heredoc/heredoc_var_expand1.right4
-rwxr-xr-xshell/ash_test/ash-heredoc/heredoc_var_expand1.tests11
3 files changed, 16 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 97379cd92..70a278f42 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12005,7 +12005,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
12005 } 12005 }
12006 } 12006 }
12007#endif 12007#endif
12008 if (eofmark == NULL || synstack->dblquote) 12008 if (!eofmark || synstack->dblquote || synstack->varnest)
12009 USTPUTC(CTLESC, out); 12009 USTPUTC(CTLESC, out);
12010 USTPUTC(c, out); 12010 USTPUTC(c, out);
12011 break; 12011 break;
diff --git a/shell/ash_test/ash-heredoc/heredoc_var_expand1.right b/shell/ash_test/ash-heredoc/heredoc_var_expand1.right
new file mode 100644
index 000000000..eb221832d
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_var_expand1.right
@@ -0,0 +1,4 @@
1
2Ok1:0
3
4Ok2:0
diff --git a/shell/ash_test/ash-heredoc/heredoc_var_expand1.tests b/shell/ash_test/ash-heredoc/heredoc_var_expand1.tests
new file mode 100755
index 000000000..3b00bab7b
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_var_expand1.tests
@@ -0,0 +1,11 @@
1x='*'
2
3cat <<- EOF
4 ${x#'*'}
5EOF
6echo Ok1:$?
7
8cat <<EOF
9${x#'*'}
10EOF
11echo Ok2:$?