From owner-svn-src-head@freebsd.org Fri Jun 1 19:56:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D33D0F713F5; Fri, 1 Jun 2018 19:56:43 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 841D16FEFE; Fri, 1 Jun 2018 19:56:43 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0AC2D51B; Fri, 1 Jun 2018 19:56:43 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w51JuhDk014742; Fri, 1 Jun 2018 19:56:43 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w51JugHh014734; Fri, 1 Jun 2018 19:56:42 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201806011956.w51JugHh014734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Fri, 1 Jun 2018 19:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334493 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 334493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2018 19:56:44 -0000 Author: pstef Date: Fri Jun 1 19:56:41 2018 New Revision: 334493 URL: https://svnweb.freebsd.org/changeset/base/334493 Log: indent(1): restore working -pcs My previous indent(1) commit accidentally broke the -pcs option (which adds space between function name and opening parenthesis in function calls) by copying all but one of a few conditions in an if clause. Reinstate the condition. Add a regression test to lower the chances of breaking it again. Correct a comment with description of what the option does. Added: head/usr.bin/indent/tests/pcs.0 (contents, props changed) head/usr.bin/indent/tests/pcs.0.pro (contents, props changed) head/usr.bin/indent/tests/pcs.0.stdout (contents, props changed) Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_globs.h head/usr.bin/indent/tests/Makefile Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Jun 1 19:47:41 2018 (r334492) +++ head/usr.bin/indent/indent.c Fri Jun 1 19:56:41 2018 (r334493) @@ -556,6 +556,7 @@ check_type: } else if (ps.want_blank && *token != '[' && ((ps.last_token != ident && ps.last_token != funcname) || + proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets * one iff -bs; all other keywords (>2) always get a space * before lparen */ Modified: head/usr.bin/indent/indent_globs.h ============================================================================== --- head/usr.bin/indent/indent_globs.h Fri Jun 1 19:47:41 2018 (r334492) +++ head/usr.bin/indent/indent_globs.h Fri Jun 1 19:56:41 2018 (r334493) @@ -168,7 +168,7 @@ int procnames_start_line; /* if true, the name * the type of the procedure and its * name) */ int proc_calls_space; /* If true, procedure calls look like: - * foo(bar) rather than foo (bar) */ + * foo (bar) rather than foo(bar) */ int format_block_comments; /* true if comments beginning with * `/ * \n' are to be reformatted */ int format_col1_comments; /* If comments which start in column 1 Modified: head/usr.bin/indent/tests/Makefile ============================================================================== --- head/usr.bin/indent/tests/Makefile Fri Jun 1 19:47:41 2018 (r334492) +++ head/usr.bin/indent/tests/Makefile Fri Jun 1 19:56:41 2018 (r334493) @@ -26,6 +26,9 @@ ${PACKAGE}FILES+= offsetof.0.stdout ${PACKAGE}FILES+= parens.0 ${PACKAGE}FILES+= parens.0.stdout ${PACKAGE}FILES+= parens.0.pro +${PACKAGE}FILES+= pcs.0 +${PACKAGE}FILES+= pcs.0.stdout +${PACKAGE}FILES+= pcs.0.pro ${PACKAGE}FILES+= sac.0 ${PACKAGE}FILES+= sac.0.stdout ${PACKAGE}FILES+= sac.0.pro Added: head/usr.bin/indent/tests/pcs.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/pcs.0 Fri Jun 1 19:56:41 2018 (r334493) @@ -0,0 +1,7 @@ +/* $FreeBSD$ */ +#include + +int main(void) { + puts("Hello"); + return 0; +} Added: head/usr.bin/indent/tests/pcs.0.pro ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/pcs.0.pro Fri Jun 1 19:56:41 2018 (r334493) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +-pcs Added: head/usr.bin/indent/tests/pcs.0.stdout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/indent/tests/pcs.0.stdout Fri Jun 1 19:56:41 2018 (r334493) @@ -0,0 +1,9 @@ +/* $FreeBSD$ */ +#include + +int +main(void) +{ + puts ("Hello"); + return 0; +}