make(1): remove unused code from needshell Since usr.bin/xinstall no longer uses this code, there is no need to keep the second parameter.diff -r1.171 -r1.172 src/usr.bin/make/compat.c
(rillig)
--- src/usr.bin/make/compat.c 2020/10/31 11:54:33 1.171
+++ src/usr.bin/make/compat.c 2020/10/31 18:20:00 1.172
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.171 2020/10/31 11:54:33 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
#include "pathnames.h"
/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: compat.c,v 1.171 2020/10/31 11:54:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.172 2020/10/31 18:20:00 rillig Exp $");
static GNode *curTarg = NULL;
static pid_t compatChild;
@@ -267,7 +267,7 @@
* meta characters as documented in make(1).
*/
- useShell = needshell(cmd, FALSE);
+ useShell = needshell(cmd);
#endif
/*
--- src/usr.bin/make/metachar.h 2020/10/31 18:17:08 1.10
+++ src/usr.bin/make/metachar.h 2020/10/31 18:20:00 1.11
@@ -1,4 +1,4 @@
-/* $NetBSD: metachar.h,v 1.10 2020/10/31 18:17:08 rillig Exp $ */
+/* $NetBSD: metachar.h,v 1.11 2020/10/31 18:20:00 rillig Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -38,14 +38,10 @@
#define is_shell_metachar(c) _metachar[(c) & 0x7f]
static inline MAKE_ATTR_UNUSED int
-needshell(const char *cmd, int white)
+needshell(const char *cmd)
{
- while (!is_shell_metachar(*cmd) && *cmd != ':' && *cmd != '=') {
- if (white && ch_isspace(*cmd))
- break;
+ while (!is_shell_metachar(*cmd) && *cmd != ':' && *cmd != '=')
cmd++;
- }
-
return *cmd != '\0';
}