diff options
author | Andy Whitcroft <apw@canonical.com> | 2009-09-21 20:04:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:48 -0400 |
commit | 30dad6ebecffebddf6b9947d11e31377fa900ff3 (patch) | |
tree | 105febf76a8f69f2194383bf027cad7e8d257d1f | |
parent | 113f04a836481e9ecc26e8dee8b0e4d52878a288 (diff) |
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 <daikerjohn@gmail.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 5 |
1 files changed, 3 insertions, 2 deletions
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 { | |||
1547 | $s =~ /^\s*#\s*?/ || | 1547 | $s =~ /^\s*#\s*?/ || |
1548 | $s =~ /^\s*$Ident\s*:/) { | 1548 | $s =~ /^\s*$Ident\s*:/) { |
1549 | $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; | 1549 | $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; |
1550 | $s =~ s/^.*?\n//; | 1550 | if ($s =~ s/^.*?\n//) { |
1551 | $cond_lines++; | 1551 | $cond_lines++; |
1552 | } | ||
1552 | } | 1553 | } |
1553 | } | 1554 | } |
1554 | 1555 | ||