From 66ae2822dd269332a06641d8fc0da0c0e60734eb Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Sun, 11 Nov 2007 21:51:20 +0000 Subject: Merge of 23115: add ";|" at end of case statement to cause testing of later patterns. --- 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 edcca82da..f53c216d8 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -167,9 +167,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 @@ -1012,7 +1012,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 ) */ @@ -1139,10 +1139,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