indent(1): Don't ignore newlines after comments that follow braces.

indent.c has a special loop that stores tokens from between an if () and
the next statement into a buffer. The loop ignored all newlines, but that
resulted in not calling dump_line() when it was needed to produce the
final line of the buffered up comment.

Taken from:	 Piotr Stefaniak
This commit is contained in:
Pedro F. Giffuni 2016-12-01 01:48:56 +00:00
parent 458051a57b
commit 67b7daecf7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309342

View File

@ -335,8 +335,10 @@ main(int argc, char **argv)
switch (type_code) {
case newline:
++line_no;
if (sc_end != NULL)
goto sw_buffer; /* dump comment, if any */
if (sc_end != NULL) { /* dump comment, if any */
*sc_end++ = '\n'; /* newlines are needed in this case */
goto sw_buffer;
}
flushed_nl = true;
case form_feed:
break; /* form feeds and newlines found here will be