Skip to content
Snippets Groups Projects
Commit 9ee33439 authored by Herbert Xu's avatar Herbert Xu
Browse files

parser: Fix single-quoted patterns in here-documents


The script

	x=*
	cat <<- EOF
		${x#'*'}
	EOF

prints * instead of nothing as it should.  The problem is that
when we're in sqsyntax context in a here-document, we won't add
CTLESC as we should.  This patch fixes it:

Reported-by: default avatarHarald van Dijk <harald@gigawatt.nl>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ab1cecb4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -934,7 +934,8 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
USTPUTC(c, out);
break;
case CCTL:
if (eofmark == NULL || synstack->dblquote)
if ((!eofmark) | synstack->dblquote |
synstack->varnest)
USTPUTC(CTLESC, out);
USTPUTC(c, out);
break;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment