Module Name: src
Committed By: christos
Date: Fri Jun 19 14:32:04 UTC 2015
Modified Files:
src/usr.bin/make: compat.c metachar.h
Log Message:
make needshell customizable, so that xinstall can use it.
To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/make/compat.c
cvs rdiff -u -r1.2 -r1.3 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.99 src/usr.bin/make/compat.c:1.100
--- src/usr.bin/make/compat.c:1.99 Fri Jun 19 10:25:34 2015
+++ src/usr.bin/make/compat.c Fri Jun 19 10:32:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.99 2015/06/19 14:25:34 christos Exp $ */
+/* $NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos 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.99 2015/06/19 14:25:34 christos Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos 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.99 2015/06/19 14:25:34 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -280,7 +280,7 @@ CompatRunCommand(void *cmdp, void *gnp)
* meta characters as documented in make(1).
*/
- useShell = needshell(cmd);
+ useShell = needshell(cmd, FALSE);
#endif
/*
Index: src/usr.bin/make/metachar.h
diff -u src/usr.bin/make/metachar.h:1.2 src/usr.bin/make/metachar.h:1.3
--- src/usr.bin/make/metachar.h:1.2 Fri Jun 19 10:25:34 2015
+++ src/usr.bin/make/metachar.h Fri Jun 19 10:32:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: metachar.h,v 1.2 2015/06/19 14:25:34 christos Exp $ */
+/* $NetBSD: metachar.h,v 1.3 2015/06/19 14:32:04 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
#define _METACHAR_H
#include <sys/cdefs.h>
+#include <ctype.h>
__BEGIN_DECLS
extern unsigned char _metachar[];
@@ -48,10 +49,13 @@ hasmeta(const char *cmd)
}
static inline int
-needshell(const char *cmd)
+needshell(const char *cmd, int white)
{
- while (!ismeta(*cmd) && *cmd != ':' && *cmd != '=')
+ while (!ismeta(*cmd) && *cmd != ':' && *cmd != '=') {
+ if (white && isspace((unsigned char)*cmd))
+ break;
cmd++;
+ }
return *cmd != '\0';
}