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(1): fix debug output for indirect modifiers



details:   https://anonhg.NetBSD.org/src/rev/9e770165c5fa
branches:  trunk
changeset: 936881:9e770165c5fa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 08 12:32:26 2020 +0000

description:
make(1): fix debug output for indirect modifiers

The trailing part after the modifier was confusing at best.  It does
make sense to log the string from p to p+rlen, but not from p+len to
p+len+len.

Consistently use double quotes for strings.

diffstat:

 usr.bin/make/unit-tests/vardebug.exp |  2 +-
 usr.bin/make/var.c                   |  9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r 5693190e77b8 -r 9e770165c5fa usr.bin/make/unit-tests/vardebug.exp
--- a/usr.bin/make/unit-tests/vardebug.exp      Sat Aug 08 12:22:10 2020 +0000
+++ b/usr.bin/make/unit-tests/vardebug.exp      Sat Aug 08 12:32:26 2020 +0000
@@ -43,7 +43,7 @@
 Result[] of :U is "value"
 Applying[] :U to ""
 Result[] of :U is "M*e"
-Got 'M*e' from '${:UM*e}':Mvalu[e
+Indirect modifier "M*e" from "${:UM*e}"
 Applying[] :M to "value"
 Pattern[] for [value] is [*e]
 ModifyWords: split "value" into 1 words
diff -r 5693190e77b8 -r 9e770165c5fa usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Aug 08 12:22:10 2020 +0000
+++ b/usr.bin/make/var.c        Sat Aug 08 12:32:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.417 2020/08/07 20:35:03 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.418 2020/08/08 12:32:26 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.417 2020/08/07 20:35:03 rillig Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.418 2020/08/08 12:32:26 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.417 2020/08/07 20:35:03 rillig Exp $");
+__RCSID("$NetBSD: var.c,v 1.418 2020/08/08 12:32:26 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -3066,8 +3066,7 @@
                goto apply_mods;
            }
 
-           VAR_DEBUG("Got '%s' from '%.*s'%.*s\n",
-                     rval, rlen, p, rlen, p + rlen);
+           VAR_DEBUG("Indirect modifier \"%s\" from \"%.*s\"\n", rval, rlen, p);
 
            p += rlen;
 



Home | Main Index | Thread Index | Old Index