Module Name:    src
Committed By:   rillig
Date:           Sun Oct 25 20:14:09 UTC 2020

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

Log Message:
make(1): split and invert complex condition in Job_CheckCommands


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 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.279 src/usr.bin/make/job.c:1.280
--- src/usr.bin/make/job.c:1.279	Sun Oct 25 20:09:28 2020
+++ src/usr.bin/make/job.c	Sun Oct 25 20:14:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.279 2020/10/25 20:09:28 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.280 2020/10/25 20:14:08 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.279 2020/10/25 20:09:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.280 2020/10/25 20:14:08 rillig Exp $");
 
 # define STATIC static
 
@@ -1179,8 +1179,14 @@ Job_Touch(GNode *gn, Boolean silent)
 Boolean
 Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
 {
-    if (!GNode_IsTarget(gn) && Lst_IsEmpty(gn->commands) &&
-	((gn->type & OP_LIB) == 0 || Lst_IsEmpty(gn->children))) {
+    if (GNode_IsTarget(gn))
+        return TRUE;
+    if (!Lst_IsEmpty(gn->commands))
+        return TRUE;
+    if ((gn->type & OP_LIB) && !Lst_IsEmpty(gn->children))
+        return TRUE;
+
+    {
 	/*
 	 * No commands. Look for .DEFAULT rule from which we might infer
 	 * commands

Reply via email to