Module Name: src
Committed By: rillig
Date: Mon Feb 1 22:06:05 UTC 2021
Modified Files:
src/usr.bin/make: parse.c
Log Message:
make: simplify VarAssign_EvalSubst
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.535 -r1.536 src/usr.bin/make/parse.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/parse.c
diff -u src/usr.bin/make/parse.c:1.535 src/usr.bin/make/parse.c:1.536
--- src/usr.bin/make/parse.c:1.535 Mon Feb 1 21:56:03 2021
+++ src/usr.bin/make/parse.c Mon Feb 1 22:06:05 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.535 2021/02/01 21:56:03 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.536 2021/02/01 22:06:05 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.535 2021/02/01 21:56:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.536 2021/02/01 22:06:05 rillig Exp $");
/* types and constants */
@@ -1888,7 +1888,6 @@ static void
VarAssign_EvalSubst(const char *name, const char *uvalue, GNode *ctxt,
FStr *out_avalue)
{
- const char *avalue;
char *evalue;
/*
@@ -1902,10 +1901,9 @@ VarAssign_EvalSubst(const char *name, co
VARE_WANTRES | VARE_KEEP_DOLLAR | VARE_KEEP_UNDEF, &evalue);
/* TODO: handle errors */
- avalue = evalue;
- Var_Set(name, avalue, ctxt);
+ Var_Set(name, evalue, ctxt);
- *out_avalue = (FStr){ avalue, evalue };
+ *out_avalue = FStr_InitOwn(evalue);
}
static void