Module Name:    src
Committed By:   rillig
Date:           Mon Nov  2 21:24:23 UTC 2020

Modified Files:
        src/usr.bin/make: var.c

Log Message:
make(1): improve local variable name in ParseVarname


To generate a diff of this commit:
cvs rdiff -u -r1.650 -r1.651 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.650 src/usr.bin/make/var.c:1.651
--- src/usr.bin/make/var.c:1.650	Mon Nov  2 21:15:00 2020
+++ src/usr.bin/make/var.c	Mon Nov  2 21:24:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.650 2020/11/02 21:15:00 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.651 2020/11/02 21:24:23 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,7 +130,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.650 2020/11/02 21:15:00 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.651 2020/11/02 21:24:23 rillig Exp $");
 
 #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1)
 #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2)
@@ -3437,6 +3437,7 @@ out:
     return st.val;
 
 bad_modifier:
+    /* XXX: The modifier end is only guessed. */
     Error("Bad modifier `:%.*s' for %s",
 	  (int)strcspn(mod, ":)}"), mod, st.v->name);
 
@@ -3527,12 +3528,12 @@ ParseVarname(const char **pp, char start
 
 	/* A variable inside a variable, expand. */
 	if (*p == '$') {
-	    void *freeIt;
-	    const char *rval;
-	    (void)Var_Parse(&p, ctxt, eflags, &rval, &freeIt);
+	    const char *nested_val;
+	    void *nested_val_freeIt;
+	    (void)Var_Parse(&p, ctxt, eflags, &nested_val, &nested_val_freeIt);
 	    /* TODO: handle errors */
-	    Buf_AddStr(&buf, rval);
-	    free(freeIt);
+	    Buf_AddStr(&buf, nested_val);
+	    free(nested_val_freeIt);
 	} else {
 	    Buf_AddByte(&buf, *p);
 	    p++;

Reply via email to