make(1): remove redundant parameter from str2Lst_Append

This commit is contained in:
rillig 2020-11-14 17:39:59 +00:00
parent 97f85a860c
commit 919a9a1235
3 changed files with 12 additions and 11 deletions

View File

@ -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 char *var, const char *suffix)
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)

View File

@ -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);

View File

@ -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}