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 VarAssign_EvalSubst



details:   https://anonhg.NetBSD.org/src/rev/e1bd6c8fbed2
branches:  trunk
changeset: 980368:e1bd6c8fbed2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Feb 01 22:06:05 2021 +0000

description:
make: simplify VarAssign_EvalSubst

No functional change.

diffstat:

 usr.bin/make/parse.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (40 lines):

diff -r d60b96c96967 -r e1bd6c8fbed2 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Mon Feb 01 21:56:03 2021 +0000
+++ b/usr.bin/make/parse.c      Mon Feb 01 22:06:05 2021 +0000
@@ -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 @@
 VarAssign_EvalSubst(const char *name, const char *uvalue, GNode *ctxt,
                    FStr *out_avalue)
 {
-       const char *avalue;
        char *evalue;
 
        /*
@@ -1902,10 +1901,9 @@
            VARE_WANTRES | VARE_KEEP_DOLLAR | VARE_KEEP_UNDEF, &evalue);
        /* TODO: handle errors */
 
-       avalue = evalue;
-       Var_Set(name, avalue, ctxt);
-
-       *out_avalue = (FStr){ avalue, evalue };
+       Var_Set(name, evalue, ctxt);
+
+       *out_avalue = FStr_InitOwn(evalue);
 }
 
 static void



Home | Main Index | Thread Index | Old Index