Re: [PATCH] gitweb: Remove extra "/" in path names for git_get_project_list

2 messages, 2 authors, 2016-08-11 · open the first message on its own page

Re: [PATCH] gitweb: Remove extra "/" in path names for git_get_project_list

From: Junio C Hamano <hidden>
Date: 2016-08-11 19:53:24

"Aneesh Kumar K.V" [off-list ref] writes:
Without this change we get a wrong $pfxlen value and the check_export_ok()
checks with with a wrong directory name. Without this patch the below
$projects_list fails with gitweb

$projects_list = "/tmp/a/b/";

Signed-off-by: Aneesh Kumar K.V <redacted>
Hmph.  Doesn't this break $projects_list = "/", I wonder?
+		# remove the trailing "/"
+		$dir =~ s!/+$!!;

Re: [PATCH] gitweb: Remove extra "/" in path names for git_get_project_list

From: Jakub Narebski <hidden>
Date: 2016-08-11 19:44:05

Junio C Hamano wrote:
"Aneesh Kumar K.V" [off-list ref] writes:
quoted
Without this change we get a wrong $pfxlen value and the check_export_ok()
checks with with a wrong directory name. Without this patch the below
$projects_list fails with gitweb

$projects_list = "/tmp/a/b/";

Signed-off-by: Aneesh Kumar K.V <redacted>
Hmph.  Doesn't this break $projects_list = "/", I wonder?
quoted
+            # remove the trailing "/"
+            $dir =~ s!/+$!!;
So perhaps

        $dir =~ s!(?<=[^/])/+$!!;

(zero-width positive look-behind assertion).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help