Skip to content

Commit

Permalink
indent(1): don't produce unnecessary blank lines.
Browse files Browse the repository at this point in the history
Don't force a blank line between an opening brace and a block comment -- not
even if -bbb (blank lines before block comments) is on.
  • Loading branch information
pstef committed Jul 23, 2017
1 parent 8c329c8 commit 5c6068c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usr.bin/indent/pr_comment.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include "indent_globs.h"
#include "indent_codes.h"
#include "indent.h"
/*
* NAME:
Expand Down Expand Up @@ -187,7 +188,7 @@ pr_comment(void)
char *t = e_com;
e_com = s_com + 2;
*e_com = 0;
if (blanklines_before_blockcomments)
if (blanklines_before_blockcomments && ps.last_token != lbrace)
prefix_blankline_requested = 1;
dump_line();
e_com = s_com = t;
Expand Down
2 changes: 2 additions & 0 deletions usr.bin/indent/tests/comments.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* $FreeBSD$ */
-bbb

0 comments on commit 5c6068c

Please sign in to comment.