projects/linux·commit 30dad6eb

checkpatch: indent checks -- stop when we run out of continuation lines

30dad6eb · Andy Whitcroft <[email protected]> · 2009-09-21 17:04:36 -07:00

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 <[email protected]>
Signed-off-by: Andy Whitcroft <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
30dad6ebecffebddf6b9947d11e31377fa900ff3
Parents
113f04a8

Changes

1 files changed · +3 −2

FileStatusAddDelContent
scripts/checkpatch.plmodified+3−2View file

scripts/checkpatch.pl

View file
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++;
+ }
}
}