Date: Sun, 3 Jun 2018 18:38:03 +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: r334581 - head/usr.bin/indent Message-ID: <201806031838.w53Ic3YJ048246@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pstef Date: Sun Jun 3 18:38:03 2018 New Revision: 334581 URL: https://svnweb.freebsd.org/changeset/base/334581 Log: indent(1): if the token is a "[" then neither of the blocks is relevant Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Jun 3 18:34:36 2018 (r334580) +++ head/usr.bin/indent/indent.c Sun Jun 3 18:38:03 2018 (r334581) @@ -569,13 +569,15 @@ check_type: nitems(ps.paren_indents)); ps.p_l_follow--; } - if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && + if (*token == '[') + /* not a function pointer declaration or a function call */; + else if (ps.in_decl && !ps.block_init && !ps.dumped_decl_indent && ps.procname[0] == '\0' && ps.paren_level == 0) { /* function pointer declarations */ indent_declaration(dec_ind, tabs_to_var); ps.dumped_decl_indent = true; } - else if (ps.want_blank && *token != '[' && + else if (ps.want_blank && ((ps.last_token != ident && ps.last_token != funcname) || proc_calls_space || /* offsetof (1) is never allowed a space; sizeof (2) gets
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806031838.w53Ic3YJ048246>