diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 42e1c50dd8..05536346a8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1367,10 +1367,10 @@ sub process { # extract the filename as it passes if ($line =~ /^diff --git.*?(\S+)$/) { $realfile = $1; - $realfile =~ s@^([^/]*)/@@; + $realfile =~ s@^([^/]*)/@@ if (!$file); } elsif ($line =~ /^\+\+\+\s+(\S+)/) { $realfile = $1; - $realfile =~ s@^([^/]*)/@@; + $realfile =~ s@^([^/]*)/@@ if (!$file); $p1_prefix = $1; if (!$file && $tree && $p1_prefix ne '' &&