about summary refs log tree commit diff
path: root/Src/parse.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-01-19 21:36:00 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-01-19 21:36:00 +0000
commitde272e0309bc1739f13cc8271a2f94bcde7ba23c (patch)
treed094cb847e41520af34ef250e4c82eea66f52016 /Src/parse.c
parenta5729be83502b3d2ba93e38a485393c9af13a935 (diff)
downloadzsh-de272e0309bc1739f13cc8271a2f94bcde7ba23c.tar.gz
zsh-de272e0309bc1739f13cc8271a2f94bcde7ba23c.tar.xz
zsh-de272e0309bc1739f13cc8271a2f94bcde7ba23c.zip
23115: ";|" at end of case clause causes later patterns to be tested
Diffstat (limited to 'Src/parse.c')
-rw-r--r--Src/parse.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/parse.c b/Src/parse.c
index a25eb3efa..afaa0d944 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -169,9 +169,9 @@ struct heredocs *hdocs;
  *
  *   WC_CASE
  *     - first CASE is always of type HEAD, data contains offset to esac
- *     - after that CASEs of type OR (;;) and AND (;&), data is offset to
- *       next case
- *     - each OR/AND case is followed by pattern, pattern-number, list
+ *     - after that CASEs of type OR (;;), AND (;&) and TESTAND (;|),
+ *       data is offset to next case
+ *     - each OR/AND/TESTAND case is followed by pattern, pattern-number, list
  *
  *   WC_IF
  *     - first IF is of type HEAD, data contains offset to fi
@@ -1014,7 +1014,7 @@ par_for(int *complex)
 /*
  * case	: CASE STRING { SEPER } ( "in" | INBRACE )
 				{ { SEPER } STRING { BAR STRING } OUTPAR
-					list [ DSEMI | SEMIAMP ] }
+					list [ DSEMI | SEMIAMP | SEMIBAR ] }
 				{ SEPER } ( "esac" | OUTBRACE )
  */
 
@@ -1141,10 +1141,12 @@ par_case(int *complex)
 	n++;
 	if (tok == SEMIAMP)
 	    type = WC_CASE_AND;
+	else if (tok == SEMIBAR)
+	    type = WC_CASE_TESTAND;
 	ecbuf[pp] = WCB_CASE(type, ecused - 1 - pp);
 	if ((tok == ESAC && !brflag) || (tok == OUTBRACE && brflag))
 	    break;
-	if (tok != DSEMI && tok != SEMIAMP)
+	if (tok != DSEMI && tok != SEMIAMP && tok != SEMIBAR)
 	    YYERRORV(oecused);
 	incasepat = 1;
 	incmdpos = 0;