summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c6
-rw-r--r--shell/ash_test/ash-heredoc/heredoc_backquote1.right5
-rwxr-xr-xshell/ash_test/ash-heredoc/heredoc_backquote1.tests10
-rw-r--r--shell/hush_test/hush-heredoc/heredoc_backquote1.right5
-rwxr-xr-xshell/hush_test/hush-heredoc/heredoc_backquote1.tests10
5 files changed, 36 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 454bc33..cf1d062 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12093,6 +12093,12 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
break;
#endif
case CBQUOTE: /* '`' */
+ if (checkkwd & CHKEOFMARK) {
+ quotef = 1;
+ USTPUTC('`', out);
+ break;
+ }
+
PARSEBACKQOLD();
break;
case CENDFILE:
diff --git a/shell/ash_test/ash-heredoc/heredoc_backquote1.right b/shell/ash_test/ash-heredoc/heredoc_backquote1.right
new file mode 100644
index 0000000..0be2a32
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_backquote1.right
@@ -0,0 +1,5 @@
+heredoc1
+Ok1:0
+heredoc2
+EO`false`F
+Ok2:0
diff --git a/shell/ash_test/ash-heredoc/heredoc_backquote1.tests b/shell/ash_test/ash-heredoc/heredoc_backquote1.tests
new file mode 100755
index 0000000..ec3d8fe
--- /dev/null
+++ b/shell/ash_test/ash-heredoc/heredoc_backquote1.tests
@@ -0,0 +1,10 @@
+cat <<EO`true`F
+heredoc1
+EO`true`F
+echo Ok1:$?
+
+cat <<EO`true`F
+heredoc2
+EO`false`F
+EO`true`F
+echo Ok2:$?
diff --git a/shell/hush_test/hush-heredoc/heredoc_backquote1.right b/shell/hush_test/hush-heredoc/heredoc_backquote1.right
new file mode 100644
index 0000000..0be2a32
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_backquote1.right
@@ -0,0 +1,5 @@
+heredoc1
+Ok1:0
+heredoc2
+EO`false`F
+Ok2:0
diff --git a/shell/hush_test/hush-heredoc/heredoc_backquote1.tests b/shell/hush_test/hush-heredoc/heredoc_backquote1.tests
new file mode 100755
index 0000000..ec3d8fe
--- /dev/null
+++ b/shell/hush_test/hush-heredoc/heredoc_backquote1.tests
@@ -0,0 +1,10 @@
+cat <<EO`true`F
+heredoc1
+EO`true`F
+echo Ok1:$?
+
+cat <<EO`true`F
+heredoc2
+EO`false`F
+EO`true`F
+echo Ok2:$?