Module Name:    src
Committed By:   rillig
Date:           Sat Apr 10 22:35:02 UTC 2021

Modified Files:
        src/usr.bin/make: var.c
        src/usr.bin/make/unit-tests: vardebug.exp varname-empty.exp

Log Message:
make: reword debug log message for empty variable name

The function names did not match anymore, after one of the many
refactorings in the last few months.


To generate a diff of this commit:
cvs rdiff -u -r1.913 -r1.914 src/usr.bin/make/var.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/varname-empty.exp

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.913 src/usr.bin/make/var.c:1.914
--- src/usr.bin/make/var.c:1.913	Sat Apr 10 22:09:53 2021
+++ src/usr.bin/make/var.c	Sat Apr 10 22:35:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.913 2021/04/10 22:09:53 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.914 2021/04/10 22:35:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.913 2021/04/10 22:09:53 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.914 2021/04/10 22:35:02 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -1040,8 +1040,9 @@ Var_SetExpandWithFlags(GNode *scope, con
 	}
 
 	if (varname.str[0] == '\0') {
-		DEBUG2(VAR, "Var_Set(\"%s\", \"%s\", ...) "
-			    "name expands to empty string - ignored\n",
+		DEBUG2(VAR,
+		    "Var_SetExpand: variable name \"%s\" expands "
+		    "to empty string, with value \"%s\" - ignored\n",
 		    unexpanded_name, val);
 	} else
 		Var_SetWithFlags(scope, varname.str, val, flags);
@@ -1165,9 +1166,9 @@ Var_AppendExpand(GNode *scope, const cha
 		/* TODO: handle errors */
 		xname = FStr_InitOwn(expanded);
 		if (expanded[0] == '\0') {
-			/* TODO: update function name in the debug message */
-			DEBUG2(VAR, "Var_Append(\"%s\", \"%s\", ...) "
-				    "name expands to empty string - ignored\n",
+			DEBUG2(VAR,
+			    "Var_AppendExpand: variable name \"%s\" expands "
+			    "to empty string, with value \"%s\" - ignored\n",
 			    name, val);
 			FStr_Done(&xname);
 			return;

Index: src/usr.bin/make/unit-tests/vardebug.exp
diff -u src/usr.bin/make/unit-tests/vardebug.exp:1.25 src/usr.bin/make/unit-tests/vardebug.exp:1.26
--- src/usr.bin/make/unit-tests/vardebug.exp:1.25	Sat Apr 10 22:09:54 2021
+++ src/usr.bin/make/unit-tests/vardebug.exp	Sat Apr 10 22:35:02 2021
@@ -5,8 +5,8 @@ Global: VAR = added
 Global: VAR = overwritten
 Global:delete VAR
 Global:delete VAR (not found)
-Var_Set("${:U}", "empty name", ...) name expands to empty string - ignored
-Var_Append("${:U}", "empty name", ...) name expands to empty string - ignored
+Var_SetExpand: variable name "${:U}" expands to empty string, with value "empty name" - ignored
+Var_AppendExpand: variable name "${:U}" expands to empty string, with value "empty name" - ignored
 Global: FROM_CMDLINE = overwritten ignored!
 Global: VAR = 1
 Global: VAR = 1 2

Index: src/usr.bin/make/unit-tests/varname-empty.exp
diff -u src/usr.bin/make/unit-tests/varname-empty.exp:1.14 src/usr.bin/make/unit-tests/varname-empty.exp:1.15
--- src/usr.bin/make/unit-tests/varname-empty.exp:1.14	Sat Apr 10 22:09:54 2021
+++ src/usr.bin/make/unit-tests/varname-empty.exp	Sat Apr 10 22:35:02 2021
@@ -1,5 +1,5 @@
-Var_Set("${:U}", "cmdline-u", ...) name expands to empty string - ignored
-Var_Set("", "cmdline-plain", ...) name expands to empty string - ignored
+Var_SetExpand: variable name "${:U}" expands to empty string, with value "cmdline-u" - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "cmdline-plain" - ignored
 Global: .CURDIR = <curdir>
 Var_Parse: ${MAKE_OBJDIR_CHECK_WRITABLE:U} (eval)
 Evaluating modifier ${MAKE_OBJDIR_CHECK_WRITABLE:U} on value "" (eval, undefined)
@@ -14,14 +14,14 @@ Global: .MAKE.MAKEFILES = varname-empty.
 Global: .PARSEFILE = varname-empty.mk
 Global:delete .INCLUDEDFROMDIR (not found)
 Global:delete .INCLUDEDFROMFILE (not found)
-Var_Set("", "default", ...) name expands to empty string - ignored
-Var_Set("", "assigned", ...) name expands to empty string - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "default" - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "assigned" - ignored
 SetVar: variable name is empty - ignored
-Var_Set("", "", ...) name expands to empty string - ignored
-Var_Set("", "subst", ...) name expands to empty string - ignored
-Var_Set("", "shell-output", ...) name expands to empty string - ignored
-Var_Set("${:U}", "assigned indirectly", ...) name expands to empty string - ignored
-Var_Append("${:U}", "appended indirectly", ...) name expands to empty string - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "" - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "subst" - ignored
+Var_SetExpand: variable name "" expands to empty string, with value "shell-output" - ignored
+Var_SetExpand: variable name "${:U}" expands to empty string, with value "assigned indirectly" - ignored
+Var_AppendExpand: variable name "${:U}" expands to empty string, with value "appended indirectly" - ignored
 Global: .MAKEFLAGS =  -r -d v -d
 Global: .MAKEFLAGS =  -r -d v -d 0
 out: fallback

Reply via email to