From 6114881d21beeecda88df3cef7ec3e3c02d7708a Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 15 Oct 2008 22:02:28 -0700 Subject: [PATCH] --- yaml --- r: 114771 b: refs/heads/master c: 306708547b566ef6a0ccd470c84568807571885c h: refs/heads/master i: 114769: a704e96f00342d3551349c370fe19220cfec9c5a 114767: a8c81e7bef0638a6251785aadc3b2467176833eb v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index ffe9d0c7fc37..8f997a5cb03f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6f779c18ca74358b6ac8eb8f5d502843fa92be4e +refs/heads/master: 306708547b566ef6a0ccd470c84568807571885c diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 2e513fdf3043..fe4553c070b1 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -1128,6 +1128,7 @@ sub process { $linenr++; my $rawline = $rawlines[$linenr - 1]; + my $hunk_line = ($realcnt != 0); #extract the line range in the file after the patch is applied if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { @@ -1238,8 +1239,8 @@ sub process { ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); } -#ignore lines being removed - if ($line=~/^-/) {next;} +# ignore non-hunk lines and lines being removed + next if (!$hunk_line || $line =~ /^-/); #trailing whitespace if ($line =~ /^\+.*\015/) {