diff options
author | Joe Perches <joe@perches.com> | 2016-01-20 17:58:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-20 20:09:18 -0500 |
commit | be17bddc6907f65b0a9f0ff77200a6d403ac41d1 (patch) | |
tree | b81dcda9c50937274cdfeea83f8e4eacf1d7e6a1 /scripts | |
parent | 75339d825ae5b1cd5bd6d4b1db3b4b7c12d7b3e9 (diff) |
scripts/get_maintainer.pl: handle file names beginning with ./
The problem is that get_maintainer.pl doesn't work if you have a ./
prefix on the filename. For example, if you type:
./scripts/get_maintainer.pl -f ./drivers/usb/usb-skeleton.c
then the current code only includes LKML and people from the git log, it
doesn't include Greg or the linux-usb list.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get_maintainer.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index cab641a12dd5..1873421f2305 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -16,7 +16,9 @@ my $P = $0; | |||
16 | my $V = '0.26'; | 16 | my $V = '0.26'; |
17 | 17 | ||
18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
19 | use Cwd; | ||
19 | 20 | ||
21 | my $cur_path = fastgetcwd() . '/'; | ||
20 | my $lk_path = "./"; | 22 | my $lk_path = "./"; |
21 | my $email = 1; | 23 | my $email = 1; |
22 | my $email_usename = 1; | 24 | my $email_usename = 1; |
@@ -429,6 +431,8 @@ foreach my $file (@ARGV) { | |||
429 | } | 431 | } |
430 | } | 432 | } |
431 | if ($from_filename) { | 433 | if ($from_filename) { |
434 | $file =~ s/^\Q${cur_path}\E//; #strip any absolute path | ||
435 | $file =~ s/^\Q${lk_path}\E//; #or the path to the lk tree | ||
432 | push(@files, $file); | 436 | push(@files, $file); |
433 | if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) { | 437 | if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) { |
434 | open(my $f, '<', $file) | 438 | open(my $f, '<', $file) |