parser: Fix backquote support in here-document EOF mark
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Apr 2018 14:38:32 +0000 (16:38 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 1 Apr 2018 14:38:32 +0000 (16:38 +0200)
commit41fddb43729373740bfba82da83373ec5ba49fc8
tree94c8010ca829d3bfe5ee02d654c65d37240c98c5
parent1e5111b0f80b1f3d7f2fc8254cb70de067317403
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>
shell/ash.c
shell/ash_test/ash-heredoc/heredoc_backquote1.right [new file with mode: 0644]
shell/ash_test/ash-heredoc/heredoc_backquote1.tests [new file with mode: 0755]
shell/hush_test/hush-heredoc/heredoc_backquote1.right [new file with mode: 0644]
shell/hush_test/hush-heredoc/heredoc_backquote1.tests [new file with mode: 0755]