From: Aneesh Kumar K.V Date: Fri, 3 Nov 2006 05:11:45 +0000 (+0530) Subject: gitweb: Remove extra "/" in path names for git_get_project_list X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/72f074d7c144d5f3e52ac9263df25b6242ebaa77c78fff8993425006766d3415 gitweb: Remove extra "/" in path names for git_get_project_list 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 Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index c2c296e..d8b50de 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -923,6 +923,8 @@ sub git_get_projects_list { if (-d $projects_list) { # search in directory my $dir = $projects_list . ($filter ? "/$filter" : ''); + # remove the trailing "/" + $dir =~ s!/+$!!; my $pfxlen = length("$dir"); my $check_forks = gitweb_check_feature('forks');