bug-indent
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trailing space left in some lines with GNU Indent 2.2.11


From: Jordan Uggla
Subject: Trailing space left in some lines with GNU Indent 2.2.11
Date: Fri, 29 May 2015 17:55:06 -0700

I am having a problem with GNU indent adding trailing whitespace when
indenting block comments. This only happens for some lines of the
block comments, seemingly those where the length of the line is
exactly one less than the value passed in --comment-line-length.
(Technically the actual length of the line is exactly the same as
--comment-line-lenght due to the extra space character added).

A minimal test case for this is a file trailing_whitespace_test.c
containing only the following:

/* foo bar foobar baz GNU Indent */

Then run "indent trailing_whitespace_test.c --format-all-comments
--format-first-column-comments --ignore-newlines --comment-line-length
10"

And to make the trailing whitespace obvious run "sed 's/ $/!/'
trailing_whitespace_test.c"

Which will output the following:

/* foo
   bar
   foobar!
   baz
   GNU
   Indent!
 */

Note the trailing spaces after "   foobar" and "   Indent", which are
each exactly 9 characters long.

I'm encountering this with the "indent" package from Debian sid,
"Version 2.2.11-4".

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]