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.
This commit is contained in:
rillig 2020-08-30 20:08:47 +00:00
parent 5dd250059b
commit dcafa71348
1 changed files with 4 additions and 9 deletions

View File

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