Module Name: src
Committed By: rillig
Date: Sat Nov 14 17:39:59 UTC 2020
Modified Files:
src/usr.bin/make: main.c make.h meta.c
Log Message:
make(1): remove redundant parameter from str2Lst_Append
To generate a diff of this commit:
cvs rdiff -u -r1.461 -r1.462 src/usr.bin/make/main.c
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/make/make.h
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/meta.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/main.c
diff -u src/usr.bin/make/main.c:1.461 src/usr.bin/make/main.c:1.462
--- src/usr.bin/make/main.c:1.461 Sat Nov 14 17:39:14 2020
+++ src/usr.bin/make/main.c Sat Nov 14 17:39:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.461 2020/11/14 17:39:14 rillig Exp $ */
+/* $NetBSD: main.c,v 1.462 2020/11/14 17:39:59 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "trace.h"
/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.461 2020/11/14 17:39:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.462 2020/11/14 17:39:59 rillig Exp $");
#if defined(MAKE_NATIVE) && !defined(lint)
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
"The Regents of the University of California. "
@@ -778,14 +778,15 @@ SetVarObjdir(Boolean writable, const cha
return TRUE;
}
+/* Splits str into words, adding them to the list.
+ * The string must be kept alive as long as the list. */
int
-str2Lst_Append(StringList *lp, char *str, const char *sep)
+str2Lst_Append(StringList *lp, char *str)
{
char *cp;
int n;
- if (sep == NULL)
- sep = " \t";
+ const char *sep = " \t";
for (n = 0, cp = strtok(str, sep); cp; cp = strtok(NULL, sep)) {
Lst_Append(lp, cp);
@@ -1318,7 +1319,7 @@ ReadFirstDefaultMakefile(void)
* since these makefiles do not come from the command line. They
* also have different semantics in that only the first file that
* is found is processed. See ReadAllMakefiles. */
- (void)str2Lst_Append(opts.makefiles, prefs, NULL);
+ (void)str2Lst_Append(opts.makefiles, prefs);
for (ln = opts.makefiles->first; ln != NULL; ln = ln->next)
if (ReadMakefile(ln->datum) == 0)
Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.207 src/usr.bin/make/make.h:1.208
--- src/usr.bin/make/make.h:1.207 Sat Nov 14 15:58:01 2020
+++ src/usr.bin/make/make.h Sat Nov 14 17:39:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.207 2020/11/14 15:58:01 rillig Exp $ */
+/* $NetBSD: make.h,v 1.208 2020/11/14 17:39:59 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -654,7 +654,7 @@ void PrintOnError(GNode *, const char *)
void Main_ExportMAKEFLAGS(Boolean);
Boolean Main_SetObjdir(Boolean, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
int mkTempFile(const char *, char **);
-int str2Lst_Append(StringList *, char *, const char *);
+int str2Lst_Append(StringList *, char *);
void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *);
Boolean GNode_ShouldExecute(GNode *gn);
Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.141 src/usr.bin/make/meta.c:1.142
--- src/usr.bin/make/meta.c:1.141 Sun Nov 8 15:07:37 2020
+++ src/usr.bin/make/meta.c Sat Nov 14 17:39:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.141 2020/11/08 15:07:37 rillig Exp $ */
+/* $NetBSD: meta.c,v 1.142 2020/11/14 17:39:59 rillig Exp $ */
/*
* Implement 'meta' mode.
@@ -633,7 +633,7 @@ meta_mode_init(const char *make_mode)
(void)Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}",
VAR_GLOBAL, VARE_WANTRES, &metaBailiwickStr);
/* TODO: handle errors */
- str2Lst_Append(metaBailiwick, metaBailiwickStr, NULL);
+ str2Lst_Append(metaBailiwick, metaBailiwickStr);
/*
* We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS}
*/
@@ -643,7 +643,7 @@ meta_mode_init(const char *make_mode)
(void)Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}",
VAR_GLOBAL, VARE_WANTRES, &metaIgnorePathsStr);
/* TODO: handle errors */
- str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr, NULL);
+ str2Lst_Append(metaIgnorePaths, metaIgnorePathsStr);
/*
* We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS}