summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/lex.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 44cfa17ca..20511f54e 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -800,7 +800,15 @@ gettok(void)
 		hwbegin(0);
 		hwaddc('\n');
 		addtoline('\n');
-		peek = NEWLIN;
+		/*
+		 * If splitting a line and removing comments,
+		 * we don't want a newline token since it's
+		 * treated specially.
+		 */
+		if (zleparse == 3 && lexstop)
+		    peek = ENDINPUT;
+		else
+		    peek = NEWLIN;
 	    }
 	}
 	return peek;