checkpatch: Fix bracing false positives on #else

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Jan Kiszka 2011-01-21 18:19:40 +01:00 committed by Blue Swirl
parent b947c12c0b
commit 789f88d0b2
1 changed files with 2 additions and 1 deletions

View File

@ -2536,7 +2536,8 @@ sub process {
}
}
if (!defined $suppress_ifbraces{$linenr - 1} &&
$line =~ /\b(if|while|for|else)\b/) {
$line =~ /\b(if|while|for|else)\b/ &&
$line !~ /\#\s*else/) {
my $allowed = 0;
# Check the pre-context.