From c166b718b496da63c4df7a0972df2fc6cd38256b Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 15 Mar 2018 18:27:30 +0800 Subject: 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 Signed-off-by: Herbert Xu --- src/parser.c | 5 +++++ 1 file changed, 5 insertions(+) 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: -- cgit 1.4.1