From: Andy Whitcroft Date: Thu, 16 Oct 2008 05:02:27 +0000 (-0700) Subject: checkpatch: suspect indent count condition lines correctly X-Git-Tag: v2.6.28-rc1~476 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=6f779c18ca74358b6ac8eb8f5d502843fa92be4e;hp=5368df20fb364e394da3ab88d3d60ee3c0a9e5ba;p=safe%2Fjmp%2Flinux-2.6 checkpatch: suspect indent count condition lines correctly Correct calculation of the number of lines of condition where we have suspect indent. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a2e4a3d..2e513fd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1417,7 +1417,8 @@ sub process { $s =~ s/\n./\n/gs; # Find out how long the conditional actually is. - my $cond_lines = 0 + $c =~ /\n/gs; + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; # We want to check the first line inside the block # starting at the end of the conditional, so remove: