Module Name: src
Committed By: rillig
Date: Sun Aug 2 10:47:09 UTC 2020
Modified Files:
src/usr.bin/make: var.c
Log Message:
make(1): eliminate local variable in ParseModifierPart
The evaluation flags passed to the nested variables consist of 3 flags.
Therefore, (eflags & VARE_UNDEFERR) | (eflags & VARE_WANTRES) is
equivalent to (eflags & ~VARE_ASSIGN).
The variable name errnum was misleading anyway, just like the other
errnum from a few commits ago that had been renamed to errfmt.
To generate a diff of this commit:
cvs rdiff -u -r1.394 -r1.395 src/usr.bin/make/var.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.394 src/usr.bin/make/var.c:1.395
--- src/usr.bin/make/var.c:1.394 Sun Aug 2 10:01:50 2020
+++ src/usr.bin/make/var.c Sun Aug 2 10:47:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.394 2020/08/02 10:01:50 rillig Exp $ */
+/* $NetBSD: var.c,v 1.395 2020/08/02 10:47:09 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.394 2020/08/02 10:01:50 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.395 2020/08/02 10:47:09 rillig Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.394 2020/08/02 10:01:50 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.395 2020/08/02 10:47:09 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1748,7 +1748,6 @@ ParseModifierPart(
) {
char *rstr;
Buffer buf;
- VarEvalFlags errnum = eflags & VARE_UNDEFERR;
Buf_InitZ(&buf, 0);
@@ -1792,8 +1791,7 @@ ParseModifierPart(
int len;
void *freeIt;
- cp2 = Var_Parse(p, ctxt, errnum | (eflags & VARE_WANTRES),
- &len, &freeIt);
+ cp2 = Var_Parse(p, ctxt, eflags & ~VARE_ASSIGN, &len, &freeIt);
Buf_AddStr(&buf, cp2);
free(freeIt);
p += len;