summaryrefslogtreecommitdiffstats
path: root/usr.bin/indent/pr_comment.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/indent/pr_comment.c')
-rw-r--r--usr.bin/indent/pr_comment.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c
index 2d4bc90..ec73d6c 100644
--- a/usr.bin/indent/pr_comment.c
+++ b/usr.bin/indent/pr_comment.c
@@ -35,6 +35,7 @@
#ifndef lint
static char sccsid[] = "@(#)pr_comment.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "@(#)$FreeBSD$";
#endif /* not lint */
#include <stdio.h>
@@ -111,10 +112,15 @@ pr_comment()
ps.com_col = 1;
}
else {
- if (*buf_ptr == '-' || *buf_ptr == '*') {
- ps.box_com = true; /* a comment with a '-' or '*' immediately
+ if (*buf_ptr == '-' || *buf_ptr == '*' ||
+ (*buf_ptr == '\n' && !format_block_comments)) {
+ ps.box_com = true; /* A comment with a '-' or '*' immediately
* after the /* is assumed to be a boxed
- * comment */
+ * comment. A comment with a newline
+ * immediately after the /* is assumed to
+ * be a block comment and is treated as a
+ * box comment unless format_block_comments
+ * is nonzero (the default). */
break_delim = 0;
}
if ( /* ps.bl_line && */ (s_lab == e_lab) && (s_code == e_code)) {
OpenPOWER on IntegriCloud