Module Name: src
Committed By: rillig
Date: Sun Aug 30 20:08:47 UTC 2020
Modified Files:
src/usr.bin/make: compat.c
Log Message:
make(1): remove unreachable code from CompatRunCommand
At the point where Str_Words is called, the string contains no
meta-characters. This means that the parameter "expand" in Str_Words is
never looked at. This in turn means that this parameter can be set to
FALSE, thereby making it impossible that Str_Words returns NULL.
To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/make/compat.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/compat.c
diff -u src/usr.bin/make/compat.c:1.138 src/usr.bin/make/compat.c:1.139
--- src/usr.bin/make/compat.c:1.138 Sun Aug 30 19:56:02 2020
+++ src/usr.bin/make/compat.c Sun Aug 30 20:08:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.138 2020/08/30 19:56:02 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.139 2020/08/30 20:08:47 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.138 2020/08/30 19:56:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.139 2020/08/30 20:08:47 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.138 2020/08/30 19:56:02 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.139 2020/08/30 20:08:47 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -314,7 +314,6 @@ CompatRunCommand(void *cmdp, void *gnp)
if (DEBUG(JOB))
fprintf(debug_file, "Execute: '%s'\n", cmd);
-again:
if (useShell) {
/*
* We need to pass the command off to the shell, typically
@@ -345,13 +344,9 @@ again:
* No meta-characters, so no need to exec a shell. Break the command
* into words to form an argument vector we can execute.
*/
- Words words = Str_Words(cmd, TRUE);
+ Words words = Str_Words(cmd, FALSE);
mav = words.words;
bp = words.freeIt;
- if (mav == NULL) {
- useShell = 1;
- goto again;
- }
av = (void *)mav;
}