diff --git a/usr.bin/make/unit-tests/test.exp b/usr.bin/make/unit-tests/test.exp
index 0b32046231aa..9cfaed9c953c 100644
--- a/usr.bin/make/unit-tests/test.exp
+++ b/usr.bin/make/unit-tests/test.exp
@@ -302,5 +302,5 @@ three FU=bar FOO=goo VAR=
four FU=bar FOO=goo VAR=Internal
five FU=bar FOO=goo VAR=Internal
five v=is x k=is x
-six v=is y k=is y
-show-v v=override k=override
+six v=is x k=is x
+show-v v=override k=is x
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index c156be3463fe..e8bc8a735c19 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.129 2008/05/14 14:27:02 sjg Exp $ */
+/* $NetBSD: var.c,v 1.130 2008/05/15 18:25:12 sjg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.129 2008/05/14 14:27:02 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.130 2008/05/15 18:25:12 sjg Exp $";
#else
#include
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.129 2008/05/14 14:27:02 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.130 2008/05/15 18:25:12 sjg Exp $");
#endif
#endif /* not lint */
#endif
@@ -746,12 +746,14 @@ Var_Set(const char *name, const char *val, GNode *ctxt, int flags)
name = Var_Subst(NULL, cp, ctxt, 0);
} else
name = cp;
+#ifdef skip_global_if_cmd
if (ctxt == VAR_GLOBAL) {
v = VarFind(name, VAR_CMD, 0);
if (v != (Var *)NIL) {
goto out;
}
}
+#endif
v = VarFind(name, ctxt, 0);
if (v == (Var *)NIL) {
VarAdd(name, val, ctxt);
@@ -783,7 +785,9 @@ Var_Set(const char *name, const char *val, GNode *ctxt, int flags)
Var_Append(MAKEOVERRIDES, name, VAR_GLOBAL);
}
+#ifdef skip_global_if_cmd
out:
+#endif
if (name != cp)
free(UNCONST(name));
if (v != (Var *)NIL)