Regression in 2.2.11
Edward Hervey <[email protected]> Sat, 03 Apr 2010 21:00:53 +0200
| Newsgroups | gmane.comp.gnu.indent.bugs |
|---|---|
| Organization | BilboEd |
| Message-ID | <1270321254.24881.20.camel@putamadre> |
Hi,
I found a regression in indent 2.2.11.
The following code
a = !!b;
Now becomes
a = ! !b;
This used to work perfectly fine with most versions of indent prior to
2.2.11.
The regression was introduced with the 'fix' for avoiding "- --a"
becomeing "---a".
A simple fix for this would be to check if the token in question is
not the '!' operator:
Line 616:
-------------
if ((parser_state_tos->last_token == unary_op) &&
- (e_code > s_code) &&
+ (e_code > s_code) && (*res != '!') &&
(*(e_code - 1) == *res))
{
*(e_code++) = ' ';
}
--------------
Sample test for regression:
------------------
int
foo(int a)
{
return !!a;
}
------------------
Edward