K 10 svn:author V 3 pfg K 8 svn:date V 27 2016-07-31T20:04:18.476062Z K 7 svn:log V 1097 indent(1): Simplify pr_comment(). Modify count_spaces() to take a third parameter "end" that will make the function return when the end is reached. This lets the caller pass a pointer to non nul-terminated sequence of characters. Rename count_spaces() to count_spaces_until() and reinstate count_spaces(), this time based on count_spaces_until(). Use count_spaces_until() to recalculate current column when going through a comment just before the fragment which decides if current line of the comment should be wrapped. This move simplifies this code by eliminating the need for keeping the column counter up to date every time e_com is advanced and also reduces spread of code that has to know how many columns a tab will produce. Deduplicate code that decided if a comment needs a blank line at the top. References: https://github.com/pstef/freebsd_indent/commit/d9fa3b481532a448095f8ddd14fd0797ce59230c https://github.com/pstef/freebsd_indent/commit/27185b4b336b0e2108a3d96aee6df80cced94192 Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak END