summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-06-20 19:51:13 +0000
committerjmallett <jmallett@FreeBSD.org>2002-06-20 19:51:13 +0000
commit3c861518879d3ccc94d9287e4e845a9c5d08c318 (patch)
tree28131396dee373ad246e28fb3941208a2e24ff8f /usr.bin/make
parent2b6583821c1f5fb4be1353a4d475e112842650f3 (diff)
downloadFreeBSD-src-3c861518879d3ccc94d9287e4e845a9c5d08c318.zip
FreeBSD-src-3c861518879d3ccc94d9287e4e845a9c5d08c318.tar.gz
Fix a bug fixed by NetBSD in revision 1.42 of parse.c by christos which caused
an example Makefile I was showing someone just last night to report a variable as being recursive. Obtained from: NetBSD
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 3e1eed5..e549bb3 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1434,6 +1434,14 @@ Parse_DoVar (line, ctxt)
Boolean oldOldVars = oldVars;
oldVars = FALSE;
+
+ /*
+ * make sure that we set the variable the first time to nothing
+ * so that it gets substituted!
+ */
+ if (!Var_Exists(line, ctxt))
+ Var_Set(line, "", ctxt);
+
cp = Var_Subst(NULL, cp, ctxt, FALSE);
oldVars = oldOldVars;
OpenPOWER on IntegriCloud