Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jul 2017 14:33:04 +0000 (UTC)
From:      Piotr Pawel Stefaniak <pstef@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321382 - in head/usr.bin/indent: . tests
Message-ID:  <201707231433.v6NEX4E2045804@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pstef
Date: Sun Jul 23 14:33:04 2017
New Revision: 321382
URL: https://svnweb.freebsd.org/changeset/base/321382

Log:
  indent(1): don't produce unnecessary blank lines.
  
  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.

Added:
  head/usr.bin/indent/tests/comments.pro   (contents, props changed)
Modified:
  head/usr.bin/indent/pr_comment.c

Modified: head/usr.bin/indent/pr_comment.c
==============================================================================
--- head/usr.bin/indent/pr_comment.c	Sun Jul 23 14:04:45 2017	(r321381)
+++ head/usr.bin/indent/pr_comment.c	Sun Jul 23 14:33:04 2017	(r321382)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include <stdlib.h>
 #include <string.h>
 #include "indent_globs.h"
+#include "indent_codes.h"
 #include "indent.h"
 /*
  * NAME:
@@ -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;

Added: head/usr.bin/indent/tests/comments.pro
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.bin/indent/tests/comments.pro	Sun Jul 23 14:33:04 2017	(r321382)
@@ -0,0 +1,2 @@
+/* $FreeBSD$ */
+-bbb



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707231433.v6NEX4E2045804>