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/d67e56f1af01
branches:  trunk
changeset: 977808:d67e56f1af01
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 8e3c75e7b557 -r d67e56f1af01 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