[klibc] [klibc:update-dash] parser: Fix backquote support in here-document EOF mark
klibc-bot for Herbert Xu
herbert at gondor.apana.org.au
Thu Jan 24 19:15:53 PST 2019
Commit-ID: 5048195d282d48b25a9a0164e60cd0e6708ec8a9
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=5048195d282d48b25a9a0164e60cd0e6708ec8a9
Author: Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Thu, 15 Mar 2018 18:27:30 +0800
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Fri, 25 Jan 2019 02:57:21 +0000
[klibc] 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 at gigawatt.nl>
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/parser.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index cd980941..ae76400e 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -1037,6 +1037,11 @@ toggledq:
}
break;
case CBQUOTE: /* '`' */
+ if (checkkwd & CHKEOFMARK) {
+ USTPUTC('`', out);
+ break;
+ }
+
PARSEBACKQOLD();
break;
case CEOF:
More information about the klibc
mailing list