about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-07-06 09:40:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-07-06 09:40:01 +0000
commitf486329a1604c44c36e14d88d04a6520cffaa8f5 (patch)
treeb719147c391bc877d46bf6a92bb78cb34b414d42
parent4a8b8bd7522df86d74bbfdb9c1086ae64ad6f861 (diff)
downloadzsh-f486329a1604c44c36e14d88d04a6520cffaa8f5.tar.gz
zsh-f486329a1604c44c36e14d88d04a6520cffaa8f5.tar.xz
zsh-f486329a1604c44c36e14d88d04a6520cffaa8f5.zip
15265: Src/parse.c: correction problems with new `for' syntax
-rw-r--r--ChangeLog2
-rw-r--r--Src/parse.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e70c20dac..209c9129a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,8 @@
 	and ${(SI:...:)...%...} indices count matches finishing
 	progressively earlier in the string.
 
+	* 15265: Src/parse.c: correction problems with new `for' syntax.
+	
 2001-07-05  Peter Stephenson  <pws@csr.com>
 
 	* 15264: Doc/Zsh/grammar.yo: improve description of use of
diff --git a/Src/parse.c b/Src/parse.c
index fd7138605..f16dcfd05 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -878,7 +878,7 @@ static void
 par_for(int *complex)
 {
     int oecused = ecused, csh = (tok == FOREACH), p, sel = (tok == SELECT);
-    int type, ona = noaliases;
+    int type;
 
     p = ecadd(0);
 
@@ -903,27 +903,29 @@ par_for(int *complex)
 	yylex();
 	type = WC_FOR_COND;
     } else {
-	int np, n, posix_in;
+	int np, n, posix_in, ona = noaliases, onc = nocorrect;
 	infor = 0;
 	if (tok != STRING || !isident(tokstr))
 	    YYERRORV(oecused);
 	np = ecadd(0);
 	n = 0;
 	incmdpos = 1;
-	noaliases = 1;
+	noaliases = nocorrect = 1;
 	for (;;) {
 	    n++;
 	    ecstr(tokstr);
 	    yylex();	
 	    if (tok != STRING || !strcmp(tokstr, "in") || sel)
 		break;
-	    if (!isident(tokstr))
+	    if (!isident(tokstr) || errflag)
 	    {
 		noaliases = ona;
+		nocorrect = onc;
 		YYERRORV(oecused);
 	    }
 	}
 	noaliases = ona;
+	nocorrect = onc;
 	ecbuf[np] = n;
 	posix_in = isnewlin;
 	while (isnewlin)