From 3c861518879d3ccc94d9287e4e845a9c5d08c318 Mon Sep 17 00:00:00 2001 From: jmallett Date: Thu, 20 Jun 2002 19:51:13 +0000 Subject: [PATCH] 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 --- usr.bin/make/parse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 3e1eed5b0358..e549bb3faaee 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;