about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 5aa63ece5..db2c2c8bd 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -116,7 +116,12 @@ mod_export int parbegin;
 
 /**/
 mod_export int parend;
+
+/* don't recognize comments */
  
+/**/
+mod_export int nocomments;
+
 /* text of puctuation tokens */
 
 /**/
@@ -672,8 +677,8 @@ gettok(void)
 
     /* chars in initial position in word */
 
-    if (c == hashchar &&
-	((zleparse != 3 && isset(INTERACTIVECOMMENTS)) ||
+    if (c == hashchar && !nocomments &&
+	(isset(INTERACTIVECOMMENTS) ||
 	 (!zleparse && !expanding &&
 	  (!interact || unset(SHINSTDIN) || strin)))) {
 	/* History is handled here to prevent extra  *