aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/indent
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-07-31 20:13:00 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-07-31 20:13:00 +0000
commit8ad92a65e4ee7703a9ced52a4bc38748b7c7df82 (patch)
tree07f1d7c20e2df99e6af902bfb2bd7de2c3e1ba28 /usr.bin/indent
parent54d57555a3e498e62133d69ba4777f7d1349d9a9 (diff)
downloadsrc-8ad92a65e4ee7703a9ced52a4bc38748b7c7df82.tar.gz
src-8ad92a65e4ee7703a9ced52a4bc38748b7c7df82.zip
indent(1): Fix wrapping of some lines in comments.
After a blank line was printed (to separate paragraphs in comments), the next line was sometimes wrapped to the column at which the previous non-empty line ended. The fix is to reset the last blank pointer (last_bl) on newline. References: https://github.com/pstef/freebsd_indent/commit/345663c07af0758fd10433bde14722dfd900f85c Differential Revision: https://reviews.freebsd.org/D6966 (Partial) Submitted by: Piotr Stefaniak
Notes
Notes: svn path=/head/; revision=303597
Diffstat (limited to 'usr.bin/indent')
-rw-r--r--usr.bin/indent/pr_comment.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c
index 5c44d3d1cfe1..f4fc50c14cd3 100644
--- a/usr.bin/indent/pr_comment.c
+++ b/usr.bin/indent/pr_comment.c
@@ -218,6 +218,7 @@ pr_comment(void)
dump_line();
return;
}
+ last_bl = NULL;
if (ps.box_com || ps.last_nl) { /* if this is a boxed comment,
* we dont ignore the newline */
if (s_com == e_com) {