History

checkpatch: correctly stop scanning at the bottom of a hunk

We are allowing context scanning checks to apply against the first line of context outside at the end of the hunk. This can lead to false matches to patch names leading to various perl warnings. Correctly stop at the bottom of the hunk.

Andy Whitcroft committed 17 years ago

Commit cc77cdc1 parent 9a974fd1 file · +2 −1Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+2−1
@@ -1234,7 +1234,6 @@ sub process { · 1233 unmodified lines
12341234 $linenr++;
12351235
12361236 my $rawline = $rawlines[$linenr - 1];
1237− my $hunk_line = ($realcnt != 0);
12381237
12391238 #extract the line range in the file after the patch is applied
12401239 if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
@@ -1274,6 +1273,8 @@ sub process { · 33 unmodified lines
12741273 $realcnt--;
12751274 }
12761275
1276+ my $hunk_line = ($realcnt != 0);
1277+
12771278 #make up the handle for any error we report on this line
12781279 $prefix = "$filename:$realline: " if ($emacs && $file);
12791280 $prefix = "$filename:$linenr: " if ($emacs && !$file);