Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/indent indent: use correct preprocessing directive i...



details:   https://anonhg.NetBSD.org/src/rev/5bc3b71e6462
branches:  trunk
changeset: 376371:5bc3b71e6462
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Jun 14 10:29:52 2023 +0000

description:
indent: use correct preprocessing directive in error message

diffstat:

 tests/usr.bin/indent/lsym_preprocessing.c |  5 ++---
 usr.bin/indent/indent.c                   |  7 +++----
 2 files changed, 5 insertions(+), 7 deletions(-)

diffs (47 lines):

diff -r d0d66a0d57bc -r 5bc3b71e6462 tests/usr.bin/indent/lsym_preprocessing.c
--- a/tests/usr.bin/indent/lsym_preprocessing.c Wed Jun 14 10:26:45 2023 +0000
+++ b/tests/usr.bin/indent/lsym_preprocessing.c Wed Jun 14 10:29:52 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_preprocessing.c,v 1.11 2023/06/14 10:26:00 rillig Exp $ */
+/* $NetBSD: lsym_preprocessing.c,v 1.12 2023/06/14 10:29:52 rillig Exp $ */
 
 /*
  * Tests for the token lsym_preprocessing, which represents a '#' that starts
@@ -296,8 +296,7 @@ int before;
 //indent run
 error: Standard Input:1: Unmatched #else
 error: Standard Input:2: Unmatched #elif
-// $ TODO: '#elifdef' instead of '#elif'
-error: Standard Input:3: Unmatched #elif
+error: Standard Input:3: Unmatched #elifdef
 error: Standard Input:4: Unmatched #endif
 #else
 #elif 0
diff -r d0d66a0d57bc -r 5bc3b71e6462 usr.bin/indent/indent.c
--- a/usr.bin/indent/indent.c   Wed Jun 14 10:26:45 2023 +0000
+++ b/usr.bin/indent/indent.c   Wed Jun 14 10:29:52 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: indent.c,v 1.360 2023/06/14 10:26:00 rillig Exp $      */
+/*     $NetBSD: indent.c,v 1.361 2023/06/14 10:29:52 rillig Exp $      */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: indent.c,v 1.360 2023/06/14 10:26:00 rillig Exp $");
+__RCSID("$NetBSD: indent.c,v 1.361 2023/06/14 10:29:52 rillig Exp $");
 
 #include <sys/param.h>
 #include <err.h>
@@ -469,8 +469,7 @@ process_preprocessing(void)
 
        } else if (dir_len >= 2 && memcmp(dir, "el", 2) == 0) {
                if (ifdef.len == 0)
-                       diag(1, dir[2] == 'i'
-                           ? "Unmatched #elif" : "Unmatched #else");
+                       diag(1, "Unmatched #%.*s", (int)dir_len, dir);
                else
                        ps = ifdef.item[ifdef.len - 1];
 



Home | Main Index | Thread Index | Old Index