summary refs log tree commit diff
path: root/src/parser.c
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/parser.c
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/parser.c')
-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:
rbox/commit/scoop.c?h=1.4&id=380132baef9edf7995429d4b31e6e112ef19b7b1&follow=1'>Execute PAGER with the SHELLJune McEnroe 2020-05-21Automatically perform database migrations in litterboxJune McEnroe 2020-05-20Don't install rc scripts on other platformsJune McEnroe 2020-05-20Rewrite build and install like pounce 1.3June McEnroe 2020-05-20Update email addressesJune McEnroe 2020-04-23Call updateConsumer from handleError 1.2p1June McEnroe 2020-04-20Use . as ${LDLIBS.$@} separatorJune McEnroe 2020-04-05Error on invalid ISUPPORT values 1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe 2020-03-31Update unscoop catgirl matchersJune McEnroe 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe