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): move complicated boolean expression ou...
details: https://anonhg.NetBSD.org/src/rev/c2c41bd63a37
branches: trunk
changeset: 937490:c2c41bd63a37
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Aug 20 18:47:57 2020 +0000
description:
make(1): move complicated boolean expression out of the function call
It's easier to inspect in a debugger this way.
diffstat:
usr.bin/make/cond.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (47 lines):
diff -r eed2ebcb11c8 -r c2c41bd63a37 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c Thu Aug 20 18:43:19 2020 +0000
+++ b/usr.bin/make/cond.c Thu Aug 20 18:47:57 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.97 2020/08/20 17:11:47 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.98 2020/08/20 18:47:57 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.97 2020/08/20 17:11:47 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.98 2020/08/20 18:47:57 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.97 2020/08/20 17:11:47 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.98 2020/08/20 18:47:57 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -392,6 +392,7 @@
int len;
Boolean qt;
const char *start;
+ VarEvalFlags eflags;
Buf_Init(&buf, 0);
str = NULL;
@@ -428,9 +429,9 @@
break;
case '$':
/* if we are in quotes, then an undefined variable is ok */
- str = Var_Parse(condExpr, VAR_CMD,
- ((!qt && doEval) ? VARE_UNDEFERR : 0) |
- (doEval ? VARE_WANTRES : 0), &len, freeIt);
+ eflags = ((!qt && doEval) ? VARE_UNDEFERR : 0) |
+ (doEval ? VARE_WANTRES : 0);
+ str = Var_Parse(condExpr, VAR_CMD, eflags, &len, freeIt);
if (str == var_Error) {
if (*freeIt) {
free(*freeIt);
Home |
Main Index |
Thread Index |
Old Index