about summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-12-13 11:20:46 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-12-13 11:20:46 +0000
commit5858e79f4d942ab13414f5efaf6f280bac690060 (patch)
tree9ff94de5937f49527b36147afd7ec7b3cf510822 /Src/lex.c
parent0a5702457b4074c72b201fb0eeb68b89763c7874 (diff)
downloadzsh-5858e79f4d942ab13414f5efaf6f280bac690060.tar.gz
zsh-5858e79f4d942ab13414f5efaf6f280bac690060.tar.xz
zsh-5858e79f4d942ab13414f5efaf6f280bac690060.zip
28526: remove bogus newline with stripped comment zplitting
Diffstat (limited to 'Src/lex.c')
-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;