summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2023-05-14 17:53:38 +0000
committerrillig <rillig@NetBSD.org>2023-05-14 17:53:38 +0000
commiteb4f3bd7339c63af4e418420d8a004e77cc93e67 (patch)
treeac39fccb72342f37f739838e84cc4afeab2bfc95 /usr.bin
parent7dc87b12cdcf7de5c6eefaceeac69e508c7fe430 (diff)
indent: fix handling of multiple block comments in a line
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/indent/pr_comment.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c
index 47cd416c361..589f3630028 100644
--- a/usr.bin/indent/pr_comment.c
+++ b/usr.bin/indent/pr_comment.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_comment.c,v 1.136 2023/05/14 17:13:37 rillig Exp $ */
+/* $NetBSD: pr_comment.c,v 1.137 2023/05/14 17:53:38 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pr_comment.c,v 1.136 2023/05/14 17:13:37 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.137 2023/05/14 17:53:38 rillig Exp $");
#include <string.h>
@@ -107,18 +107,13 @@ analyze_comment(bool *p_may_wrap, bool *p_break_delim,
break_delim = false;
}
- /*
- * XXX: This condition looks suspicious since it ignores the case
- * where the end of the previous comment is still in 'com'.
- *
- * See test lsym_comment.c, keyword 'analyze_comment'.
- */
+ if (com.e != com.s)
+ output_line();
if (lab.s == lab.e && code.s == code.e) {
adj_max_line_length = opt.block_comment_max_line_length;
com_ind = (ps.ind_level - opt.unindent_displace) * opt.indent_size;
if (com_ind <= 0)
com_ind = opt.format_col1_comments ? 0 : 1;
-
} else {
break_delim = false;