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
14171417 $s =~ s/\n./\n/gs;
14181418
14191419 # 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;
14211422
14221423 # We want to check the first line inside the block
14231424 # starting at the end of the conditional, so remove: