Example code:
----------------------------------------
int
main ()
{
if (1)
{
}
//
return 0;
}
----------------------------------------
Running "indent --cuddle-else" removes the empty line after "if":
----------------------------------------
$ indent --cuddle-else a.c -o b.c
$ diff -u a.c b.c
--- a.c 2008-05-13 01:30:57.000000000 +0200
+++ b.c 2008-05-13 01:31:08.000000000 +0200
@@ -16,7 +16,6 @@
if (1)
{
}
-
//
return 0;
}
----------------------------------------
Expected result:
The line should not be removed.
It seems all these conditions must be met for the bug to appear:
1) --cuddle-else option used
2) "if" with braces and without "else"
3) Followed by one or more empty lines, then a "//"-comment
If there is more than one empty line, only one will be removed.
--
Håkon
_______________________________________________
bug-indent mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-indent