Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105387
b: refs/heads/master
c: 548596d
h: refs/heads/master
i:
  105385: 232de50
  105383: eda13a7
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Jul 24, 2008
1 parent 2f67743 commit 2a7b334
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: a3bb97a7aba36055d476896ed6393ab35a119d5b
refs/heads/master: 548596d523d83dff5a670beb84be0daf4c3bcd16
15 changes: 10 additions & 5 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1249,17 +1249,22 @@ sub process {
my $pre_ctx = "$1$2";

my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
my $ctx_ln = $linenr + $#ctx + 1;
my $ctx_cnt = $realcnt - $#ctx - 1;
my $ctx = join("\n", @ctx);

##warn "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
my $ctx_ln = $linenr;
my $ctx_skip = $realcnt;

# Skip over any removed lines in the context following statement.
while (defined($lines[$ctx_ln - 1]) && $lines[$ctx_ln - 1] =~ /^-/) {
while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt &&
defined $lines[$ctx_ln - 1] &&
$lines[$ctx_ln - 1] =~ /^-/)) {
##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n";
$ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/);
$ctx_ln++;
}
##warn "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";

##print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n";
##print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n";

if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln -1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) {
ERROR("that open brace { should be on the previous line\n" .
Expand Down

0 comments on commit 2a7b334

Please sign in to comment.