summaryrefslogtreecommitdiff
path: root/usr.bin/make/parse.c
diff options
context:
space:
mode:
authorsjg <sjg@NetBSD.org>2016-12-09 22:56:21 +0000
committersjg <sjg@NetBSD.org>2016-12-09 22:56:21 +0000
commit7101b387912e52ef8c14a87a6225232f8b044fee (patch)
treeb81d93bbc7e01b2ef23bbf03ed6e141de9598fab /usr.bin/make/parse.c
parentcd1016f04126ee50a8a0d654cd862aed1c04b88d (diff)
Avoid coredump for
(FOO) = fu reported by Ori Bernstein
Diffstat (limited to 'usr.bin/make/parse.c')
-rw-r--r--usr.bin/make/parse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index f8f89a2b9a8..7bf9dddb783 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.216 2016/12/07 15:00:46 christos Exp $ */
+/* $NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.216 2016/12/07 15:00:46 christos Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.216 2016/12/07 15:00:46 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.217 2016/12/09 22:56:21 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -1851,7 +1851,7 @@ Parse_DoVar(char *line, GNode *ctxt)
* XXX Rather than counting () and {} we should look for $ and
* then expand the variable.
*/
- for (depth = 0, cp = line + 1; depth != 0 || *cp != '='; cp++) {
+ for (depth = 0, cp = line + 1; depth > 0 || *cp != '='; cp++) {
if (*cp == '(' || *cp == '{') {
depth++;
continue;