svn commit: r309343 - head/usr.bin/indent

Pedro F. Giffuni pfg at FreeBSD.org
Thu Dec 1 01:56:36 UTC 2016


Author: pfg
Date: Thu Dec  1 01:56:34 2016
New Revision: 309343
URL: https://svnweb.freebsd.org/changeset/base/309343

Log:
  indent(1): Don't unnecessarily add a blank before a comment ends.
  
  pr_comment() did avoid adding surplus space character when a comment
  contained it at the end. Now it's also paying attention to tabs.
  
  Taken from:	 Piotr Stefaniak

Modified:
  head/usr.bin/indent/pr_comment.c

Modified: head/usr.bin/indent/pr_comment.c
==============================================================================
--- head/usr.bin/indent/pr_comment.c	Thu Dec  1 01:48:56 2016	(r309342)
+++ head/usr.bin/indent/pr_comment.c	Thu Dec  1 01:56:34 2016	(r309343)
@@ -293,7 +293,7 @@ pr_comment(void)
 			s_com = e_com;
 		    *e_com++ = ' ';
 		}
-		if (e_com[-1] != ' ' && !ps.box_com)
+		if (e_com[-1] != ' ' && e_com[-1] != '\t' && !ps.box_com)
 		    *e_com++ = ' ';	/* ensure blank before end */
 		*e_com++ = '*', *e_com++ = '/', *e_com = '\0';
 		ps.just_saw_decl = l_just_saw_decl;


More information about the svn-src-all mailing list