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: make end of comment detection of nowr...



details:   https://anonhg.NetBSD.org/src/rev/02167effd8c4
branches:  trunk
changeset: 1024834:02167effd8c4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 07 10:34:03 2021 +0000

description:
indent: make end of comment detection of nowrap comments simpler

No functional change.

diffstat:

 usr.bin/indent/pr_comment.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r fd17cb494d46 -r 02167effd8c4 usr.bin/indent/pr_comment.c
--- a/usr.bin/indent/pr_comment.c       Sun Nov 07 10:31:12 2021 +0000
+++ b/usr.bin/indent/pr_comment.c       Sun Nov 07 10:34:03 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pr_comment.c,v 1.106 2021/11/07 10:31:12 rillig Exp $  */
+/*     $NetBSD: pr_comment.c,v 1.107 2021/11/07 10:34:03 rillig Exp $  */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.106 2021/11/07 10:31:12 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.107 2021/11/07 10:34:03 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
 #endif
@@ -352,10 +352,8 @@
        }
 
        com_add_char(inp_next());
-       if (com.e[-1] == '*' && *inp.s == '/' && token.e[-1] == '*') {
-           com_add_char(inp_next());
+       if (com.e[-2] == '*' && com.e[-1] == '/' && token.e[-1] == '*')
            goto finish;
-       }
     }
 
 finish:



Home | Main Index | Thread Index | Old Index