ash: parser: Fix single-quoted patterns in here-documents
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 2 Apr 2018 11:29:20 +0000 (13:29 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 2 Apr 2018 11:29:20 +0000 (13:29 +0200)
commitc4c2012284c3a3a45843e9400379c84855d853ef
tree113aef7b5e6ac339a919faec68c935d679a74b02
parent8b536eb40d7b4e65e3a0223ada7246f538ac6e98
ash: parser: Fix single-quoted patterns in here-documents

Upstream commit:

    From: Herbert Xu <herbert@gondor.apana.org.au>
    Date: Fri, 9 Mar 2018 23:07:53 +0800
    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: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c
shell/ash_test/ash-heredoc/heredoc_var_expand1.right [new file with mode: 0644]
shell/ash_test/ash-heredoc/heredoc_var_expand1.tests [new file with mode: 0755]