Date: Thu, 1 Dec 2016 01:56:35 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309343 - head/usr.bin/indent Message-ID: <201612010156.uB11uZXK055376@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612010156.uB11uZXK055376>