summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-09-30 10:57:44 +0000
committertjr <tjr@FreeBSD.org>2002-09-30 10:57:44 +0000
commitf162697f7c77dad5b4c7c425c7bb8928ba756d96 (patch)
tree156e36596c5ea4fd2e024199c274aa75dd2f8e22 /bin/sh/parser.c
parent99be6c217c0195535d047f340802b5b283e268ba (diff)
downloadFreeBSD-src-f162697f7c77dad5b4c7c425c7bb8928ba756d96.zip
FreeBSD-src-f162697f7c77dad5b4c7c425c7bb8928ba756d96.tar.gz
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>
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 5da28ad..8a2e988 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -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;
OpenPOWER on IntegriCloud