diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-01 17:38:32 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-01 17:38:32 +0300 |
commit | 41fddb43729373740bfba82da83373ec5ba49fc8 (patch) | |
tree | 94c8010ca829d3bfe5ee02d654c65d37240c98c5 /shell/ash.c | |
parent | 1e5111b0f80b1f3d7f2fc8254cb70de067317403 (diff) |
parser: Fix backquote support in here-document EOF mark
Upstream commit:
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Mar 15 18:27:30 2018 +0800
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>
With added fix for quoted-ness of the EOF mark.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 454bc3317..cf1d062fb 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: |