summaryrefslogtreecommitdiff
path: root/usr.bin/make/make.c
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-07-28 16:42:22 +0000
committerrillig <rillig@NetBSD.org>2020-07-28 16:42:22 +0000
commitdb046a67bc26faa3b275ba028628b9386bf73ce4 (patch)
treed8a6a3254470634cbdc9a1e1b16479e081289a16 /usr.bin/make/make.c
parent8b629886f8acc6e6586a6bd963303e2a0e419afc (diff)
make(1): remove dead code from Var_Subst
The first parameter from Var_Subst had been a literal NULL in all cases. These have been fixed using this command: sed -i 's|Var_Subst(NULL, |Var_Subst(|' *.c The one remaining case was not found because the "NULL," was followed by a line break instead of a space. The removed code probably wouldn't have worked as expected anyway. Expanding a single variable to a literal string would have led to unexpected behavior for cases like ${VAR:M${pattern}}, in case pattern would contain an unescaped ':' itself.
Diffstat (limited to 'usr.bin/make/make.c')
-rw-r--r--usr.bin/make/make.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 3ed1f94be01..88a281a828c 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $ */
+/* $NetBSD: make.c,v 1.101 2020/07/28 16:42:22 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.101 2020/07/28 16:42:22 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.100 2020/07/19 12:26:17 rillig Exp $");
+__RCSID("$NetBSD: make.c,v 1.101 2020/07/28 16:42:22 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -484,7 +484,7 @@ Make_HandleUse(GNode *cgn, GNode *pgn)
} else {
free(gn->name);
}
- gn->name = Var_Subst(NULL, gn->uname, pgn, VARE_WANTRES);
+ gn->name = Var_Subst(gn->uname, pgn, VARE_WANTRES);
if (gn->name && gn->uname && strcmp(gn->name, gn->uname) != 0) {
/* See if we have a target for this node. */
tgn = Targ_FindNode(gn->name, TARG_NOCREATE);