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): remove redundant condition from ApplyM...



details:   https://anonhg.NetBSD.org/src/rev/52ac304fcff3
branches:  trunk
changeset: 942020:52ac304fcff3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Nov 04 02:53:18 2020 +0000

description:
make(1): remove redundant condition from ApplyModifiersIndirect

Whenever varUndefined is returned from another function, that is only
done if eflags does not contain VARE_UNDEFERR.  Therefore, testing for
that flag is unnecessary.

diffstat:

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

diffs (30 lines):

diff -r 04c4648e4f6c -r 52ac304fcff3 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Wed Nov 04 02:26:21 2020 +0000
+++ b/usr.bin/make/var.c        Wed Nov 04 02:53:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.653 2020/11/04 02:26:21 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.654 2020/11/04 02:53:18 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.653 2020/11/04 02:26:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.654 2020/11/04 02:53:18 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3299,9 +3299,8 @@
        st->val = ApplyModifiers(&rval_pp, st->val, '\0', '\0', st->v,
                                 &st->exprFlags, st->ctxt, st->eflags,
                                 out_freeIt);
-       if (st->val == var_Error
-           || (st->val == varUndefined && !(st->eflags & VARE_UNDEFERR))
-           || *rval_pp != '\0') {
+       if (st->val == var_Error || st->val == varUndefined ||
+           *rval_pp != '\0') {
            free(mods_freeIt);
            *inout_p = p;
            return AMIR_OUT;    /* error already reported */



Home | Main Index | Thread Index | Old Index