Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): document why runIgnImpl is used in job...



details:   https://anonhg.NetBSD.org/src/rev/9f45c16115fc
branches:  trunk
changeset: 1017037:9f45c16115fc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Dec 11 01:08:51 2020 +0000

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

diffstat:

 usr.bin/make/job.c |  17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diffs (39 lines):

diff -r 2a2d58d559d0 -r 9f45c16115fc usr.bin/make/job.c
--- a/usr.bin/make/job.c        Fri Dec 11 01:06:10 2020 +0000
+++ b/usr.bin/make/job.c        Fri Dec 11 01:08:51 2020 +0000
@@ -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 @@
                                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;
                }
        }



Home | Main Index | Thread Index | Old Index