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): fix yoda-style comparisons in var.c



details:   https://anonhg.NetBSD.org/src/rev/d1a83a7e01c1
branches:  trunk
changeset: 937061:d1a83a7e01c1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 08 12:37:37 2020 +0000

description:
make(1): fix yoda-style comparisons in var.c

diffstat:

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

diffs (48 lines):

diff -r 08f7e019bca9 -r d1a83a7e01c1 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Aug 08 12:35:15 2020 +0000
+++ b/usr.bin/make/var.c        Sat Aug 08 12:37:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.419 2020/08/08 12:35:15 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.420 2020/08/08 12:37:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.419 2020/08/08 12:35:15 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.420 2020/08/08 12:37:37 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)var.c      8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: var.c,v 1.419 2020/08/08 12:35:15 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.420 2020/08/08 12:37:37 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -455,7 +455,7 @@
        Var *v = (Var *)Hash_GetValue(he);
        if (v->flags & VAR_EXPORTED)
            unsetenv(v->name);
-       if (strcmp(MAKE_EXPORTED, v->name) == 0)
+       if (strcmp(v->name, MAKE_EXPORTED) == 0)
            var_exportedVars = VAR_EXPORTED_NONE;
        if (v->name != he->name)
            free(v->name);
@@ -572,10 +572,10 @@
     snprintf(tmp, sizeof(tmp), "%d", makelevel + 1);
     setenv(MAKE_LEVEL_ENV, tmp, 1);
 
-    if (VAR_EXPORTED_NONE == var_exportedVars)
+    if (var_exportedVars == VAR_EXPORTED_NONE)
        return;
 
-    if (VAR_EXPORTED_ALL == var_exportedVars) {
+    if (var_exportedVars == VAR_EXPORTED_ALL) {
        /* Ouch! This is crazy... */
        Hash_ForEach(&VAR_GLOBAL->context, Var_ExportVars_callback, NULL);
        return;



Home | Main Index | Thread Index | Old Index