about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/lex.c3
-rw-r--r--Test/A01grammar.ztst12
3 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 782dd06f3..4e00629cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-27  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 26622: Src/lex.c, Test/A01grammar.ztst: improve 26617 and add
+	test.
+
 2009-02-26  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 26617, c.f. Tomáš Smetana, 26610: Src/lex.c: comments
@@ -11252,5 +11257,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4582 $                         
+* $Revision: 1.4583 $                         
 *****************************************************
diff --git a/Src/lex.c b/Src/lex.c
index 6e14612f7..466447963 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1813,7 +1813,7 @@ skipcomm(void)
 	c = hgetc();
 	if (itok(c) || lexstop)
 	    break;
-	iswhite = isep(c);
+	iswhite = inblank(c);
 	switch (c) {
 	case '(':
 	    pct++;
@@ -1861,6 +1861,7 @@ skipcomm(void)
 		add(c);
 		while ((c = hgetc()) != '\n' && !lexstop)
 		    add(c);
+		iswhite = 1;
 	    }
 	    break;
 	}
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index f283451ce..a1ec2cc00 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -503,3 +503,15 @@
   $ZTST_testdir/../Src/zsh -f NonExistentScript
 127q:Non-existent script causes exit status 127
 ?$ZTST_testdir/../Src/zsh: can't open input file: NonExistentScript
+
+  (setopt nonomatch
+  # use this to get stuff at start of line
+  contents=$'# comment \'\necho value #with " stuff\n# comment\n#comment
+  echo not#comment\n'
+  eval 'VAR=$('"$contents"')'
+  print -l $VAR)
+0:comments within $(...)
+>value
+>not#comment
+
+