From 04a398293c8b100742adc47284a8ea15d406e671 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 8 Sep 2003 08:23:29 +0000 Subject: Command line variables take precedence over global variables. Make this true in the .for loops too. The following fragment, FOO= foo bar all: .for f in ${FOO} @echo ${f} .endfor when run as "make FOO=xxx" should print "xxx". (OpenBSD had this bug fixed for some time.) --- usr.bin/make/for.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index 87890af9012c..a194ef9a7f28 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -172,7 +172,7 @@ For_Eval (char *line) */ forLst = Lst_Init(FALSE); buf = Buf_Init(0); - sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE); + sub = Var_Subst(NULL, ptr, VAR_CMD, FALSE); #define ADDWORD() \ Buf_AddBytes(buf, ptr - wrd, (Byte *) wrd), \ -- cgit v1.3