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): reduce number of nested parentheses in...



details:   https://anonhg.NetBSD.org/src/rev/3a29a767abcf
branches:  trunk
changeset: 941945:3a29a767abcf
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 01 21:28:42 2020 +0000

description:
make(1): reduce number of nested parentheses in ApplyModifier_Assign

diffstat:

 usr.bin/make/var.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (37 lines):

diff -r 2ceb31ff86d9 -r 3a29a767abcf usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sun Nov 01 21:11:49 2020 +0000
+++ b/usr.bin/make/var.c        Sun Nov 01 21:28:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.637 2020/11/01 18:48:13 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.638 2020/11/01 21:28:42 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.637 2020/11/01 18:48:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.638 2020/11/01 21:28:42 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -2949,11 +2949,13 @@
 
     const char *mod = *pp;
     const char *op = mod + 1;
-    if (!(op[0] == '=' ||
-         (op[1] == '=' &&
-          (op[0] == '!' || op[0] == '+' || op[0] == '?'))))
-       return AMR_UNKNOWN;     /* "::<unrecognised>" */
-
+
+    if (op[0] == '=')
+        goto ok;
+    if ((op[0] == '!' || op[0] == '+' || op[0] == '?') && op[1] == '=')
+       goto ok;
+    return AMR_UNKNOWN;                /* "::<unrecognised>" */
+ok:
 
     if (st->v->name[0] == '\0') {
        *pp = mod + 1;



Home | Main Index | Thread Index | Old Index