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): omit trailing space in debug output fo...



details:   https://anonhg.NetBSD.org/src/rev/1cc8285c2bc5
branches:  trunk
changeset: 956260:1cc8285c2bc5
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Oct 25 09:19:10 2020 +0000

description:
make(1): omit trailing space in debug output for expanding file patterns

diffstat:

 usr.bin/make/dir.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r af65a0936a8f -r 1cc8285c2bc5 usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Oct 25 09:10:46 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Oct 25 09:19:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.183 2020/10/25 09:10:46 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.184 2020/10/25 09:19:10 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -135,7 +135,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.183 2020/10/25 09:10:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.184 2020/10/25 09:19:10 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -757,12 +757,14 @@
 }
 
 static void
-DirPrintExpansions(StringList *words)
+PrintExpansions(StringList *expansions)
 {
+    const char *sep = "";
     StringListNode *ln;
-    for (ln = words->first; ln != NULL; ln = ln->next) {
+    for (ln = expansions->first; ln != NULL; ln = ln->next) {
        const char *word = ln->datum;
-       debug_printf("%s ", word);
+       debug_printf("%s%s", sep, word);
+       sep = " ";
     }
     debug_printf("\n");
 }
@@ -862,7 +864,7 @@
        }
     }
     if (DEBUG(DIR))
-       DirPrintExpansions(expansions);
+       PrintExpansions(expansions);
 }
 
 /* Find if the file with the given name exists in the given path.



Home | Main Index | Thread Index | Old Index