Allow empty case/esac statements; POSIX requires this, and recent versions

of autoconf are generating scripts that use this feature.

PR:		43275 35879
Submitted by:	Dan Nelson <dnelson@allantgroup.com>
This commit is contained in:
Tim J. Robbins 2002-09-30 10:57:44 +00:00
parent 045df95d10
commit e00e16ad7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104202

View File

@ -429,7 +429,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
cpp = &n1->ncase.cases;
noaliases = 1; /* turn off alias expansion */
checkkwd = 2, readtoken();
do {
while (lasttoken != TESAC) {
*cpp = cp = (union node *)stalloc(sizeof (struct nclist));
cp->type = NCLIST;
app = &cp->nclist.pattern;
@ -456,7 +456,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
checkkwd = 2, readtoken();
}
cpp = &cp->nclist.next;
} while(lasttoken != TESAC);
}
noaliases = 0; /* reset alias expansion */
*cpp = NULL;
checkkwd = 1;