Module Name:    src
Committed By:   rillig
Date:           Sun Oct 25 07:46:05 UTC 2020

Modified Files:
        src/usr.bin/make: dir.c

Log Message:
make(1): remove unused parameter from DirFindDot


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/usr.bin/make/dir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.177 src/usr.bin/make/dir.c:1.178
--- src/usr.bin/make/dir.c:1.177	Sun Oct 25 07:44:16 2020
+++ src/usr.bin/make/dir.c	Sun Oct 25 07:46:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.177 2020/10/25 07:44:16 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.178 2020/10/25 07:46:05 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.177 2020/10/25 07:44:16 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.178 2020/10/25 07:46:05 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -1009,34 +1009,23 @@ DirLookupAbs(CachedDir *dir, const char 
     return bmake_strdup(name);
 }
 
-/*-
- *-----------------------------------------------------------------------
- * DirFindDot  --
- *	Find the file given on "." or curdir
- *
- * Results:
- *	The path to the file or NULL. This path is guaranteed to be in a
- *	different part of memory than name and so may be safely free'd.
- *
- * Side Effects:
- *	Hit counts change
- *-----------------------------------------------------------------------
- */
+/* Find the file given on "." or curdir.
+ * Return the freshly allocated path to the file, or NULL. */
 static char *
-DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp)
+DirFindDot(const char *name, const char *base)
 {
 
-    if (Hash_FindEntry(&dot->files, cp) != NULL) {
+    if (Hash_FindEntry(&dot->files, base) != NULL) {
 	DIR_DEBUG0("   in '.'\n");
 	hits++;
 	dot->hits++;
 	return bmake_strdup(name);
     }
-    if (cur && Hash_FindEntry(&cur->files, cp) != NULL) {
+    if (cur != NULL && Hash_FindEntry(&cur->files, base) != NULL) {
 	DIR_DEBUG1("   in ${.CURDIR} = %s\n", cur->name);
 	hits++;
 	cur->hits++;
-	return str_concat3(cur->name, "/", cp);
+	return str_concat3(cur->name, "/", base);
     }
 
     return NULL;
@@ -1125,7 +1114,7 @@ Dir_FindFile(const char *name, SearchPat
 	 * This is so there are no conflicts between what the user
 	 * specifies (fish.c) and what pmake finds (./fish.c).
 	 */
-	if (!hasLastDot && (file = DirFindDot(hasSlash, name, base)) != NULL)
+	if (!hasLastDot && (file = DirFindDot(name, base)) != NULL)
 	    return file;
 
 	for (; ln != NULL; ln = ln->next) {
@@ -1136,7 +1125,7 @@ Dir_FindFile(const char *name, SearchPat
 		return file;
 	}
 
-	if (hasLastDot && (file = DirFindDot(hasSlash, name, base)) != NULL)
+	if (hasLastDot && (file = DirFindDot(name, base)) != NULL)
 	    return file;
     }
 

Reply via email to