Module Name: src
Committed By: christos
Date: Mon Feb 22 19:42:46 UTC 2016
Modified Files:
src/bin/sh: parser.c
Log Message:
Fix for PR bin/48631 - allow commands controlled
by case statements to be nothing more than redirects (from kre)
To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/bin/sh/parser.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.96 src/bin/sh/parser.c:1.97
--- src/bin/sh/parser.c:1.96 Mon Feb 22 14:38:10 2016
+++ src/bin/sh/parser.c Mon Feb 22 14:42:46 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: parser.c,v 1.96 2016/02/22 19:38:10 christos Exp $ */
+/* $NetBSD: parser.c,v 1.97 2016/02/22 19:42:46 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#else
-__RCSID("$NetBSD: parser.c,v 1.96 2016/02/22 19:38:10 christos Exp $");
+__RCSID("$NetBSD: parser.c,v 1.97 2016/02/22 19:42:46 christos Exp $");
#endif
#endif /* not lint */
@@ -515,6 +515,12 @@ TRACE(("expecting DO got %s %s\n", tokna
tokpushback++;
n1 = simplecmd(rpp, redir);
goto checkneg;
+ case TENDCASE:
+ if (redir) {
+ tokpushback++;
+ goto checkneg;
+ }
+ /* FALLTHROUGH */
default:
synexpect(-1);
/* NOTREACHED */