mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: get_maintainer.pl: unexpected behaviour for path/to//file
Date: Fri, 15 May 2020 05:31:10 -0700	[thread overview]
Message-ID: <134d34de7e35861f33d3a1d9ffd8a70b0f92df33.camel@perches.com> (raw)
In-Reply-To: <20200515105203.2792466-1-emil.l.velikov@gmail.com>

On Fri, 2020-05-15 at 11:52 +0100, Emil Velikov wrote:
> Hi Joe,
> 
> Recently I've noticed that get_maintainer behaves differently if there
> is a double, sequential, forward slash in the path.
> 
> AFAICT there should be no distinction between the two. Or at least many
> existing applications and scripts consider them one and the same.
> 
> I've tried fixing this, although my perl isn't quite up-to scratch.
> Is this some weird bug or some intended feature?

Not really an intended feature.
The code counts slashes for directory depth.

I suppose it might be simpler to do this:
---
 scripts/get_maintainer.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 6d973f3685f9..eaaf9373dbcf 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -538,6 +538,7 @@ foreach my $file (@ARGV) {
 	} elsif (!(-f $file)) {
 	    die "$P: file '${file}' not found\n";
 	}
+	$file =~ s@//@/@g;	# compress file double slashes
     }
     if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) {
 	$file =~ s/^\Q${cur_path}\E//;	#strip any absolute path


  reply	other threads:[~2020-05-15 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 10:52 Emil Velikov
2020-05-15 12:31 ` Joe Perches [this message]
2020-05-15 17:22   ` Joe Perches
2020-05-17 15:47     ` Emil Velikov
2020-05-15 19:06   ` [PATCH] get_maintainer: Fix unexpected behavior for path/to//file (double slashes) Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=134d34de7e35861f33d3a1d9ffd8a70b0f92df33.camel@perches.com \
    --to=joe@perches.com \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®