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 parameter of DirLookup



details:   https://anonhg.NetBSD.org/src/rev/bf6a55b92135
branches:  trunk
changeset: 1015505:bf6a55b92135
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 25 07:44:16 2020 +0000

description:
make(1): rename parameter of DirLookup

The DirLookup functions work on "name", which may be a complete path,
and on "base" or "cp", which is the basename of the file.  Don't use
"name" for the basename, since that would be confusing.

diffstat:

 usr.bin/make/dir.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 381567e976b4 -r bf6a55b92135 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Oct 25 07:32:07 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Oct 25 07:44:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.176 2020/10/25 07:32:07 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.177 2020/10/25 07:44:16 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.176 2020/10/25 07:32:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.177 2020/10/25 07:44:16 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -905,16 +905,16 @@
 /* Find if the file with the given name exists in the given path.
  * Return the freshly allocated path to the file, or NULL. */
 static char *
-DirLookup(CachedDir *dir, const char *name)
+DirLookup(CachedDir *dir, const char *base)
 {
     char *file;                        /* the current filename to check */
 
     DIR_DEBUG1("   %s ...\n", dir->name);
 
-    if (Hash_FindEntry(&dir->files, name) == NULL)
+    if (Hash_FindEntry(&dir->files, base) == NULL)
        return NULL;
 
-    file = str_concat3(dir->name, "/", name);
+    file = str_concat3(dir->name, "/", base);
     DIR_DEBUG1("   returning %s\n", file);
     dir->hits++;
     hits++;



Home | Main Index | Thread Index | Old Index