Module Name: src Committed By: rillig Date: Sat Oct 31 18:20:01 UTC 2020
Modified Files: src/usr.bin/make: compat.c metachar.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.171 -r1.172 src/usr.bin/make/compat.c cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/metachar.h 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/compat.c diff -u src/usr.bin/make/compat.c:1.171 src/usr.bin/make/compat.c:1.172 --- src/usr.bin/make/compat.c:1.171 Sat Oct 31 11:54:33 2020 +++ src/usr.bin/make/compat.c Sat Oct 31 18:20:00 2020 @@ -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 @@ Compat_RunCommand(const char *cmdp, GNod * meta characters as documented in make(1). */ - useShell = needshell(cmd, FALSE); + useShell = needshell(cmd); #endif /* Index: src/usr.bin/make/metachar.h diff -u src/usr.bin/make/metachar.h:1.10 src/usr.bin/make/metachar.h:1.11 --- src/usr.bin/make/metachar.h:1.10 Sat Oct 31 18:17:08 2020 +++ src/usr.bin/make/metachar.h Sat Oct 31 18:20:00 2020 @@ -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 @@ extern unsigned char _metachar[]; #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'; }