History

checkpatch: suspect indent count condition lines correctly

Correct calculation of the number of lines of condition where we have suspect indent.

Andy Whitcroft committed 18 years ago

Commit 6f779c11 parent 5368df21 file · +2 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+2−1
@@ -1417,7 +1417,8 @@ sub process { · 1416 unmodified lines
1417 $s =~ s/\n./\n/gs;1417 $s =~ s/\n./\n/gs;
1418 1418
1419 # Find out how long the conditional actually is.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 # We want to check the first line inside the block1423 # We want to check the first line inside the block
1423 # starting at the end of the conditional, so remove:1424 # starting at the end of the conditional, so remove: