Module Name: src
Committed By: rillig
Date: Sun Jul 26 18:11:12 UTC 2020
Modified Files:
src/usr.bin/make: nonints.h var.c
Log Message:
make(1): merge VARE_NOSUBST into VARE_WANTRES
The flag VARE_NOSUBST is only a few days old. It had grown out of the
VARP_NOSUBST and VAR_NOSUBST flags, not knowing at that time that it
meant the exact opposite of VARE_WANTRES.
To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.322 -r1.323 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/nonints.h
diff -u src/usr.bin/make/nonints.h:1.82 src/usr.bin/make/nonints.h:1.83
--- src/usr.bin/make/nonints.h:1.82 Mon Jul 20 19:53:40 2020
+++ src/usr.bin/make/nonints.h Sun Jul 26 18:11:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.82 2020/07/20 19:53:40 rillig Exp $ */
+/* $NetBSD: nonints.h,v 1.83 2020/07/26 18:11:12 rillig Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -181,12 +181,9 @@ void Targ_Propagate_Wait(void);
typedef enum {
/* Treat undefined variables as errors. */
VARE_UNDEFERR = 0x01,
- /* Actually evaluate the text, fully expanding variables.
- * Without this flag, the text is only parsed but not evaluated. */
+ /* Expand and evaluate variables during parsing. */
VARE_WANTRES = 0x02,
- VARE_ASSIGN = 0x04,
- /* Return the literal text, without expanding variables. */
- VARE_NOSUBST = 0x08
+ VARE_ASSIGN = 0x04
} VarEvalFlags;
void Var_Delete(const char *, GNode *);
Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.322 src/usr.bin/make/var.c:1.323
--- src/usr.bin/make/var.c:1.322 Sun Jul 26 17:44:54 2020
+++ src/usr.bin/make/var.c Sun Jul 26 18:11:12 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.322 2020/07/26 17:44:54 rillig Exp $ */
+/* $NetBSD: var.c,v 1.323 2020/07/26 18:11:12 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.322 2020/07/26 17:44:54 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.323 2020/07/26 18:11:12 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.322 2020/07/26 17:44:54 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.323 2020/07/26 18:11:12 rillig Exp $");
#endif
#endif /* not lint */
#endif
@@ -1834,7 +1834,7 @@ ParseModifierPart(GNode *ctxt, const cha
else
Buf_AddByte(&buf, *cp);
} else {
- if (!(eflags & VARE_NOSUBST)) {
+ if (eflags & VARE_WANTRES) {
char *cp2;
int len;
void *freeIt;
@@ -2075,7 +2075,7 @@ ApplyModifier_Loop(const char *mod, Appl
st->cp = mod + 1;
char delim = '@';
args.tvar = ParseModifierPart(st->ctxt, &st->cp, delim,
- st->eflags | VARE_NOSUBST,
+ st->eflags & ~VARE_WANTRES,
NULL, NULL, NULL);
if (args.tvar == NULL) {
st->missing_delim = delim;
@@ -2083,7 +2083,7 @@ ApplyModifier_Loop(const char *mod, Appl
}
args.str = ParseModifierPart(st->ctxt, &st->cp, delim,
- st->eflags | VARE_NOSUBST,
+ st->eflags & ~VARE_WANTRES,
NULL, NULL, NULL);
if (args.str == NULL) {
st->missing_delim = delim;
@@ -2857,9 +2857,8 @@ ApplyModifier_Assign(const char *mod, Ap
}
char delim = st->startc == PROPEN ? PRCLOSE : BRCLOSE;
- VarEvalFlags eflags = (st->eflags & VARE_WANTRES) ? 0 : VARE_NOSUBST;
char *val = ParseModifierPart(st->ctxt, &st->cp, delim,
- st->eflags | eflags, NULL, NULL, NULL);
+ st->eflags, NULL, NULL, NULL);
if (st->v->flags & VAR_JUNK) {
/* restore original name */
free(st->v->name);