Correct calculation of the number of lines of condition where we have suspect indent.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -1417,7 +1417,8 @@ sub process { · 1416 unmodified lines | ||
| 1417 | 1417 | $s =~ s/\n./\n/gs; |
| 1418 | 1418 | |
| 1419 | 1419 | # Find out how long the conditional actually is. |
| 1420 | − my $cond_lines = 0 + $c =~ /\n/gs; | |
| 1420 | + my @newlines = ($c =~ /\n/gs); | |
| 1421 | + my $cond_lines = 1 + $#newlines; | |
| 1421 | 1422 | |
| 1422 | 1423 | # We want to check the first line inside the block |
| 1423 | 1424 | # starting at the end of the conditional, so remove: |