From db46c9cd5844240fb6015666c8e2a12a0a3a6ead Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Thu, 9 Sep 2021 20:05:39 +0100
Subject: 49353: Fix comments in sourced file.
If the file was sourced from an interactive shell with
INTERACTIVE_COMMENTS not set, comments were not parsed.
Note there is a remaining edge case where the sourced
file is in fact entered at the comment line.
---
Test/A01grammar.ztst | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'Test/A01grammar.ztst')
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 88fc8606e..c114ff103 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -944,3 +944,12 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci
if : ${(e)a}; then echo x; fi
1:Status on bad substitution in if without else
?(eval):2: bad substitution
+
+ echo 'echo foo # comment
+ echo $(
+ echo bar # comment
+ )' >source_comments.zsh
+ $ZTST_testdir/../Src/zsh -f -o extendedglob -is -c '. ./source_comments.zsh'
+0:Comments should be handled in command subst in interactively sourced files
+>foo
+>bar
--
cgit 1.4.1