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): make test for dynamic variable name mo...



details:   https://anonhg.NetBSD.org/src/rev/82ff042bda55
branches:  trunk
changeset: 936443:82ff042bda55
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 23:03:54 2020 +0000

description:
make(1): make test for dynamic variable name more specific

Since all the string literals have either 7 or 8 characters, there is no
need to call strcmp for shorter or longer variable names.

diffstat:

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

diffs (35 lines):

diff -r 151bafa86401 -r 82ff042bda55 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Jul 26 22:43:16 2020 +0000
+++ b/usr.bin/make/var.c        Sun Jul 26 23:03:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.335 2020/07/26 22:43:16 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.336 2020/07/26 23:03:54 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.335 2020/07/26 22:43:16 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.336 2020/07/26 23:03:54 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.335 2020/07/26 22:43:16 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.336 2020/07/26 23:03:54 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3384,7 +3384,7 @@
        return FALSE;
     }
 
-    if (namelen > 2 && varname[0] == '.' &&
+    if ((namelen == 7 || namelen == 8) && varname[0] == '.' &&
        isupper((unsigned char) varname[1]) &&
        (ctxt == VAR_CMD || ctxt == VAR_GLOBAL))
     {



Home | Main Index | Thread Index | Old Index