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: simplify evaluation of function 'empty'
details: https://anonhg.NetBSD.org/src/rev/ccde253c1f21
branches: trunk
changeset: 1027558:ccde253c1f21
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Dec 11 10:28:59 2021 +0000
description:
make: simplify evaluation of function 'empty'
No functional change.
diffstat:
usr.bin/make/cond.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diffs (35 lines):
diff -r c579bc969617 -r ccde253c1f21 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c Sat Dec 11 10:21:02 2021 +0000
+++ b/usr.bin/make/cond.c Sat Dec 11 10:28:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.293 2021/12/11 10:21:02 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.294 2021/12/11 10:28:59 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@
#include "dir.h"
/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */
-MAKE_RCSID("$NetBSD: cond.c,v 1.293 2021/12/11 10:21:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.294 2021/12/11 10:28:59 rillig Exp $");
/*
* The parsing of conditional expressions is based on this grammar:
@@ -753,13 +753,9 @@
return false;
tok = ParseEmptyArg(&cp, doEval);
- if (tok == TOK_ERROR) {
- par->p = cp;
- *out_token = TOK_ERROR;
- return true;
- }
-
- *out_token = ToToken(!doEval || tok == TOK_TRUE);
+ if (tok == TOK_FALSE && !doEval)
+ tok = TOK_TRUE;
+ *out_token = tok;
par->p = cp;
return true;
}
Home |
Main Index |
Thread Index |
Old Index