Module Name: src
Committed By: rillig
Date: Thu May 26 16:45:25 UTC 2022
Modified Files:
src/usr.bin/xlint/lint1: debug.c
Log Message:
lint: fix spacing and line breaks in debug logging
The spacing between function arguments in a declaration info was too
big, it was the indentation level instead of a single space.
The function debug_sym is used for two purposes: own-line and in-line,
which coincidentally are distinguished by whether the suffix string is
"\n".
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint1/debug.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/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.20 src/usr.bin/xlint/lint1/debug.c:1.21
--- src/usr.bin/xlint/lint1/debug.c:1.20 Thu May 26 12:04:56 2022
+++ src/usr.bin/xlint/lint1/debug.c Thu May 26 16:45:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.20 2022/05/26 12:04:56 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.21 2022/05/26 16:45:25 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.20 2022/05/26 12:04:56 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.21 2022/05/26 16:45:25 rillig Exp $");
#endif
#include <stdlib.h>
@@ -264,7 +264,8 @@ void
debug_sym(const char *prefix, const sym_t *sym, const char *suffix)
{
- debug_print_indent();
+ if (suffix[0] == '\n')
+ debug_print_indent();
debug_printf("%s%s", prefix, sym->s_name);
if (sym->s_type != NULL)
debug_printf(" type='%s'", type_name(sym->s_type));