Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): move comment in Var_Set_with_flags



details:   https://anonhg.NetBSD.org/src/rev/c3bc1350f75f
branches:  trunk
changeset: 956161:c3bc1350f75f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 23 13:38:17 2020 +0000

description:
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.

diffstat:

 usr.bin/make/var.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r b971bf403800 -r c3bc1350f75f usr.bin/make/var.c
--- a/usr.bin/make/var.c        Fri Oct 23 12:13:04 2020 +0000
+++ b/usr.bin/make/var.c        Fri Oct 23 13:38:17 2020 +0000
@@ -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 @@
 
     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 @@
        }
     }
 
+    /*
+     * 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)) {



Home | Main Index | Thread Index | Old Index