From de272e0309bc1739f13cc8271a2f94bcde7ba23c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 19 Jan 2007 21:36:00 +0000 Subject: 23115: ";|" at end of case clause causes later patterns to be tested --- Src/parse.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Src/parse.c') 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; -- cgit 1.4.1