Module Name:    src
Committed By:   rillig
Date:           Fri Dec 11 01:08:51 UTC 2020

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

Log Message:
make(1): document why runIgnImpl is used in jobs mode


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 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/job.c
diff -u src/usr.bin/make/job.c:1.366 src/usr.bin/make/job.c:1.367
--- src/usr.bin/make/job.c:1.366	Fri Dec 11 00:29:01 2020
+++ src/usr.bin/make/job.c	Fri Dec 11 01:08:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.366 2020/12/11 00:29:01 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.367 2020/12/11 01:08:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -143,7 +143,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.366 2020/12/11 00:29:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.367 2020/12/11 01:08:51 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -903,14 +903,13 @@ JobPrintCommand(Job *job, const char * c
 				cmdFlags.echo = FALSE;
 			}
 			/*
-			 * If it's a comment line or blank, treat as an
-			 * ignored error.
+			 * If it's a comment line or blank, avoid the possible
+			 * syntax error generated by "{\n} || exit 0".
 			 */
-			if (escCmd[0] == shell->commentChar ||
-			    (escCmd[0] == '\0'))
-				cmdTemplate = shell->runIgnTmpl;
-			else
-				cmdTemplate = shell->runChkTmpl;
+			cmdTemplate = escCmd[0] == shell->commentChar ||
+				      escCmd[0] == '\0'
+			    ? shell->runIgnTmpl
+			    : shell->runChkTmpl;
 			cmdFlags.ignerr = FALSE;
 		}
 	}

Reply via email to