Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114761
b: refs/heads/master
c: 9bd49ef
h: refs/heads/master
i:
  114759: 959402c
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 16, 2008
1 parent 55cd8b5 commit ad7909d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d001e4d88a57ba8347b43e3a20412cd6b67fbd7
refs/heads/master: 9bd49efe4e4bf88d9c1026db50325fd1b2e59519
25 changes: 15 additions & 10 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ sub process {
if ($s =~ s/^\s*\\//) {
$continuation = 1;
}
if ($s =~ s/^\s*\n//) {
if ($s =~ s/^\s*?\n//) {
$check = 1;
$cond_lines++;
}
Expand All @@ -1446,15 +1446,20 @@ sub process {
$check = 0;
}

# Ignore the current line if its is a preprocessor
# line.
if ($s =~ /^\s*#\s*/) {
$check = 0;
}
my $cond_ptr = -1;
while ($cond_ptr != $cond_lines) {
$cond_ptr = $cond_lines;

# Ignore the current line if it is label.
if ($s =~ /^\s*$Ident\s*:/) {
$check = 0;
# Ignore:
# 1) blank lines, they should be at 0,
# 2) preprocessor lines, and
# 3) labels.
if ($s =~ /^\s*?\n/ ||
$s =~ /^\s*#\s*?/ ||
$s =~ /^\s*$Ident\s*:/) {
$s =~ s/^.*?\n//;
$cond_lines++;
}
}

my (undef, $sindent) = line_stats("+" . $s);
Expand All @@ -1470,7 +1475,7 @@ sub process {
$stat_real = "[...]\n$stat_real";
}

##print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";
#print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n";

if ($check && (($sindent % 8) != 0 ||
($sindent <= $indent && $s ne ''))) {
Expand Down

0 comments on commit ad7909d

Please sign in to comment.