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): rename defIncPath to defSysIncPath



details:   https://anonhg.NetBSD.org/src/rev/27f8a5ee2ec3
branches:  trunk
changeset: 977598:27f8a5ee2ec3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Oct 28 03:21:25 2020 +0000

description:
make(1): rename defIncPath to defSysIncPath

There are two variables, parseIncPath and sysIncPath, which made the
name defIncPath ambiguous.

diffstat:

 usr.bin/make/main.c  |  22 ++++++++++++----------
 usr.bin/make/make.h  |   4 ++--
 usr.bin/make/parse.c |  14 +++++++-------
 3 files changed, 21 insertions(+), 19 deletions(-)

diffs (150 lines):

diff -r fea877c845f0 -r 27f8a5ee2ec3 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Wed Oct 28 03:12:54 2020 +0000
+++ b/usr.bin/make/main.c       Wed Oct 28 03:21:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.408 2020/10/27 19:16:46 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.409 2020/10/28 03:21:25 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -118,7 +118,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.408 2020/10/27 19:16:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.409 2020/10/28 03:21:25 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -1141,7 +1141,7 @@
 }
 
 static void
-InitDefIncPath(char *syspath)
+InitDefSysIncPath(char *syspath)
 {
        static char defsyspath[] = _PATH_DEFSYSPATH;
        char *start, *cp;
@@ -1165,11 +1165,11 @@
                }
                /* look for magic parent directory search string */
                if (strncmp(".../", start, 4) != 0) {
-                       (void)Dir_AddDir(defIncPath, start);
+                       (void)Dir_AddDir(defSysIncPath, start);
                } else {
                        char *dir = Dir_FindHereOrAbove(curdir, start + 4);
                        if (dir != NULL) {
-                               (void)Dir_AddDir(defIncPath, dir);
+                               (void)Dir_AddDir(defSysIncPath, dir);
                                free(dir);
                        }
                }
@@ -1184,7 +1184,7 @@
 {
        StringList *sysMkPath = Lst_New();
        Dir_Expand(_PATH_DEFSYSMK,
-                  Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath,
+                  Lst_IsEmpty(sysIncPath) ? defSysIncPath : sysIncPath,
                   sysMkPath);
        if (Lst_IsEmpty(sysMkPath))
                Fatal("%s: no system rules (%s).", progname, _PATH_DEFSYSMK);
@@ -1515,7 +1515,7 @@
 
        InitVarTargets();
 
-       InitDefIncPath(syspath);
+       InitDefSysIncPath(syspath);
 
        /*
         * Read in the built-in rules first, followed by the specified
@@ -1634,9 +1634,11 @@
                }
                /* look in -I and system include directories. */
                name = Dir_FindFile(fname, parseIncPath);
-               if (!name)
-                       name = Dir_FindFile(fname,
-                               Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath);
+               if (!name) {
+                       SearchPath *sysInc = Lst_IsEmpty(sysIncPath)
+                                            ? defSysIncPath : sysIncPath;
+                       name = Dir_FindFile(fname, sysInc);
+               }
                if (!name || (fd = open(name, O_RDONLY)) == -1) {
                        free(name);
                        free(path);
diff -r fea877c845f0 -r 27f8a5ee2ec3 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Wed Oct 28 03:12:54 2020 +0000
+++ b/usr.bin/make/make.h       Wed Oct 28 03:21:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.174 2020/10/27 07:03:55 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.175 2020/10/28 03:21:25 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -447,7 +447,7 @@
 extern Boolean oldVars;        /* Do old-style variable substitution */
 
 extern SearchPath *sysIncPath; /* The system include path. */
-extern SearchPath *defIncPath; /* The default include path. */
+extern SearchPath *defSysIncPath; /* The default system include path. */
 
 extern char    curdir[];       /* Startup directory */
 extern char    *progname;      /* The program name */
diff -r fea877c845f0 -r 27f8a5ee2ec3 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Wed Oct 28 03:12:54 2020 +0000
+++ b/usr.bin/make/parse.c      Wed Oct 28 03:21:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.408 2020/10/28 03:12:54 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.409 2020/10/28 03:21:25 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.408 2020/10/28 03:12:54 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.409 2020/10/28 03:21:25 rillig Exp $");
 
 /* types and constants */
 
@@ -280,10 +280,10 @@
     return GetInclude(includes.len - 1);
 }
 
-/* include paths (lists of directories) */
+/* include paths */
 SearchPath *parseIncPath;      /* dirs for "..." includes */
 SearchPath *sysIncPath;                /* dirs for <...> includes */
-SearchPath *defIncPath;                /* default for sysIncPath */
+SearchPath *defSysIncPath;             /* default for sysIncPath */
 
 /* parser tables */
 
@@ -2206,7 +2206,7 @@
        /*
         * Look for it on the system path
         */
-       SearchPath *path = Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath;
+       SearchPath *path = Lst_IsEmpty(sysIncPath) ? defSysIncPath : sysIncPath;
        fullname = Dir_FindFile(file, path);
     }
 
@@ -3144,7 +3144,7 @@
     mainNode = NULL;
     parseIncPath = Lst_New();
     sysIncPath = Lst_New();
-    defIncPath = Lst_New();
+    defSysIncPath = Lst_New();
     Vector_Init(&includes, sizeof(IFile));
 #ifdef CLEANUP
     targCmds = Lst_New();
@@ -3158,7 +3158,7 @@
 #ifdef CLEANUP
     Lst_Destroy(targCmds, free);
     assert(targets == NULL);
-    Lst_Destroy(defIncPath, Dir_Destroy);
+    Lst_Destroy(defSysIncPath, Dir_Destroy);
     Lst_Destroy(sysIncPath, Dir_Destroy);
     Lst_Destroy(parseIncPath, Dir_Destroy);
     assert(includes.len == 0);



Home | Main Index | Thread Index | Old Index