From: Andy Whitcroft Date: Tue, 22 Sep 2009 00:04:36 +0000 (-0700) Subject: checkpatch: indent checks -- stop when we run out of continuation lines X-Git-Tag: v2.6.32-rc1~431 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=30dad6ebecffebddf6b9947d11e31377fa900ff3 checkpatch: indent checks -- stop when we run out of continuation lines Ensure we terminate when there are no futher continuation lines when trying to determine relative indent of conditionals and their blocks. Reported-by: John Daiker 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 aa009a3..b6f267b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1547,8 +1547,9 @@ sub process { $s =~ /^\s*#\s*?/ || $s =~ /^\s*$Ident\s*:/) { $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; - $s =~ s/^.*?\n//; - $cond_lines++; + if ($s =~ s/^.*?\n//) { + $cond_lines++; + } } }