summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-09-30 13:25:00 +0000
committertjr <tjr@FreeBSD.org>2002-09-30 13:25:00 +0000
commitbe381197cdcf5d7ce025ab36cad95e0a5f88ee0c (patch)
treec5a8d36832ddcaef9d468c7b866a98b72b960a9e /bin/sh
parent5a5cffa0bd6f2588debc8bc600a0c103f6e81ccb (diff)
downloadFreeBSD-src-be381197cdcf5d7ce025ab36cad95e0a5f88ee0c.zip
FreeBSD-src-be381197cdcf5d7ce025ab36cad95e0a5f88ee0c.tar.gz
Allow a left parenthesis before patterns in case blocks. POSIX requires
us to accept this, but I've never seen a script that uses it.
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 8a2e988..69d6405 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -433,6 +433,8 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
*cpp = cp = (union node *)stalloc(sizeof (struct nclist));
cp->type = NCLIST;
app = &cp->nclist.pattern;
+ if (lasttoken == TLP)
+ readtoken();
for (;;) {
*app = ap = (union node *)stalloc(sizeof (struct narg));
ap->type = NARG;
OpenPOWER on IntegriCloud