From 41fddb43729373740bfba82da83373ec5ba49fc8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 1 Apr 2018 16:38:32 +0200 Subject: parser: Fix backquote support in here-document EOF mark Upstream commit: Author: Herbert Xu 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 Signed-off-by: Herbert Xu With added fix for quoted-ness of the EOF mark. Signed-off-by: Denys Vlasenko --- shell/ash_test/ash-heredoc/heredoc_backquote1.right | 5 +++++ shell/ash_test/ash-heredoc/heredoc_backquote1.tests | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 shell/ash_test/ash-heredoc/heredoc_backquote1.right create mode 100755 shell/ash_test/ash-heredoc/heredoc_backquote1.tests (limited to 'shell/ash_test') diff --git a/shell/ash_test/ash-heredoc/heredoc_backquote1.right b/shell/ash_test/ash-heredoc/heredoc_backquote1.right new file mode 100644 index 0000000..0be2a32 --- /dev/null +++ b/shell/ash_test/ash-heredoc/heredoc_backquote1.right @@ -0,0 +1,5 @@ +heredoc1 +Ok1:0 +heredoc2 +EO`false`F +Ok2:0 diff --git a/shell/ash_test/ash-heredoc/heredoc_backquote1.tests b/shell/ash_test/ash-heredoc/heredoc_backquote1.tests new file mode 100755 index 0000000..ec3d8fe --- /dev/null +++ b/shell/ash_test/ash-heredoc/heredoc_backquote1.tests @@ -0,0 +1,10 @@ +cat <