Module Name: src
Committed By: rillig
Date: Sat Mar 13 18:11:31 UTC 2021
Modified Files:
src/usr.bin/indent: pr_comment.c
Log Message:
indent: remove the '+ 1' from right margin calculation in comment
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/indent/pr_comment.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/indent/pr_comment.c
diff -u src/usr.bin/indent/pr_comment.c:1.29 src/usr.bin/indent/pr_comment.c:1.30
--- src/usr.bin/indent/pr_comment.c:1.29 Sat Mar 13 13:51:08 2021
+++ src/usr.bin/indent/pr_comment.c Sat Mar 13 18:11:31 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pr_comment.c,v 1.29 2021/03/13 13:51:08 rillig Exp $ */
+/* $NetBSD: pr_comment.c,v 1.30 2021/03/13 18:11:31 rillig Exp $ */
/*-
* SPDX-License-Identifier: BSD-4-Clause
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)pr_comment.c
#include <sys/cdefs.h>
#ifndef lint
#if defined(__NetBSD__)
-__RCSID("$NetBSD: pr_comment.c,v 1.29 2021/03/13 13:51:08 rillig Exp $");
+__RCSID("$NetBSD: pr_comment.c,v 1.30 2021/03/13 18:11:31 rillig Exp $");
#elif defined(__FreeBSD__)
__FBSDID("$FreeBSD: head/usr.bin/indent/pr_comment.c 334927 2018-06-10 16:44:18Z pstef $");
#endif
@@ -200,8 +200,9 @@ process_comment(void)
if (t_ptr >= buf_end)
fill_buffer();
if (t_ptr[0] == '*' && t_ptr[1] == '/') {
- /* XXX: strange mixture between indentation, column, length */
- if (adj_max_line_length >= 1 + indentation_after_range(ps.com_col - 1, buf_ptr, t_ptr + 2))
+ int right_margin = indentation_after_range(ps.com_col - 1,
+ buf_ptr, t_ptr + 2);
+ if (right_margin < adj_max_line_length)
break_delim = false;
break;
}