Module Name: src
Committed By: rillig
Date: Fri Oct 23 13:38:17 UTC 2020
Modified Files:
src/usr.bin/make: var.c
Log Message:
make(1): move comment in Var_Set_with_flags
Until 2000-05-11, that comment was just above a VarFind call. 20 years
later, it is back again where it belongs.
To generate a diff of this commit:
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/make/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.581 src/usr.bin/make/var.c:1.582
--- src/usr.bin/make/var.c:1.581 Thu Oct 22 05:50:02 2020
+++ src/usr.bin/make/var.c Fri Oct 23 13:38:17 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.581 2020/10/22 05:50:02 rillig Exp $ */
+/* $NetBSD: var.c,v 1.582 2020/10/23 13:38:17 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.581 2020/10/22 05:50:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.582 2020/10/23 13:38:17 rillig Exp $");
#define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
#define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -762,11 +762,6 @@ Var_Set_with_flags(const char *name, con
assert(val != NULL);
- /*
- * We only look for a variable in the given context since anything set
- * here will override anything in a lower context, so there's not much
- * point in searching them all just to save a bit of memory...
- */
if (strchr(name, '$') != NULL) {
(void)Var_Subst(name, ctxt, VARE_WANTRES, &name_freeIt);
/* TODO: handle errors */
@@ -792,6 +787,11 @@ Var_Set_with_flags(const char *name, con
}
}
+ /*
+ * We only look for a variable in the given context since anything set
+ * here will override anything in a lower context, so there's not much
+ * point in searching them all just to save a bit of memory...
+ */
v = VarFind(name, ctxt, 0);
if (v == NULL) {
if (ctxt == VAR_CMD && !(flags & VAR_NO_EXPORT)) {