Commit 30dad6eb authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds

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: default avatarJohn Daiker <daikerjohn@gmail.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 113f04a8
......@@ -1547,10 +1547,11 @@ sub process {
$s =~ /^\s*#\s*?/ ||
$s =~ /^\s*$Ident\s*:/) {
$continuation = ($s =~ /^.*?\\\n/) ? 1 : 0;
$s =~ s/^.*?\n//;
if ($s =~ s/^.*?\n//) {
$cond_lines++;
}
}
}
my (undef, $sindent) = line_stats("+" . $s);
my $stat_real = raw_line($linenr, $cond_lines);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment