summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2018-03-15 18:27:30 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2018-03-22 00:29:58 +0800
commitc166b718b496da63c4df7a0972df2fc6cd38256b (patch)
tree4e2b4a4ad7ce9b0fb2e5cc137dc583a016bdf076 /src
parentshell: provide .gitignore (diff)
downloaddash-c166b718b496da63c4df7a0972df2fc6cd38256b.tar.gz
dash-c166b718b496da63c4df7a0972df2fc6cd38256b.zip
parser: Fix backquote support in here-document EOF mark
Currently using backquotes in a here-document EOF mark is broken
because dash tries to do command substitution on it.  This patch
fixes it by checking whether we're looking for an EOF mark during
tokenisation.

Reported-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'src')
-rw-r--r--src/parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index cd98094..ae76400 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1037,6 +1037,11 @@ toggledq:
 				}
 				break;
 			case CBQUOTE:	/* '`' */
+				if (checkkwd & CHKEOFMARK) {
+					USTPUTC('`', out);
+					break;
+				}
+
 				PARSEBACKQOLD();
 				break;
 			case CEOF: