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-Url: http://git.osdn.net/view?a=commitdiff_plain;h=30dad6ebecffebddf6b9947d11e31377fa900ff3;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git 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 aa009a3b5b81..b6f267b72035 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++; + } } }