Module Name:    src
Committed By:   christos
Date:           Tue Jan 17 21:35:19 UTC 2023

Modified Files:
        src/usr.bin/make: compat.c job.c

Log Message:
Accept whitespace between command specifiers @+- like gmake does. New binutils
does this.


To generate a diff of this commit:
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/make/compat.c
cvs rdiff -u -r1.456 -r1.457 src/usr.bin/make/job.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.243 src/usr.bin/make/compat.c:1.244
--- src/usr.bin/make/compat.c:1.243	Wed Dec  7 05:28:48 2022
+++ src/usr.bin/make/compat.c	Tue Jan 17 16:35:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.243 2022/12/07 10:28:48 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.244 2023/01/17 21:35:19 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -91,7 +91,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.243 2022/12/07 10:28:48 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.244 2023/01/17 21:35:19 christos Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -280,7 +280,8 @@ Compat_RunCommand(const char *cmdp, GNod
 			doIt = true;
 			if (shellName == NULL)	/* we came here from jobs */
 				Shell_Init();
-		} else
+		} else if (!ch_isspace(*cmd))
+			/* Ignore whitespace for compatibility with gnu make */
 			break;
 		cmd++;
 	}

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.456 src/usr.bin/make/job.c:1.457
--- src/usr.bin/make/job.c:1.456	Mon Oct 10 17:17:25 2022
+++ src/usr.bin/make/job.c	Tue Jan 17 16:35:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.456 2022/10/10 21:17:25 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.457 2023/01/17 21:35:19 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.456 2022/10/10 21:17:25 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.457 2023/01/17 21:35:19 christos Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -732,7 +732,8 @@ ParseCommandFlags(char **pp, CommandFlag
 			out_cmdFlags->ignerr = true;
 		else if (*p == '+')
 			out_cmdFlags->always = true;
-		else
+		else if (!ch_isspace(*p))
+			/* Ignore whitespace for compatibility with gnu make */
 			break;
 		p++;
 	}

Reply via email to