gitweb: Remove extra "/" in path names for git_get_project_list
authorAneesh Kumar K.V <aneesh.kumar@gmail.com>
Fri, 3 Nov 2006 05:11:45 +0000 (10:41 +0530)
committerJunio C Hamano <junkio@cox.net>
Sat, 4 Nov 2006 09:51:35 +0000 (01:51 -0800)
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 <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl

index 3dfa59f616c78cea8147e58aee1accde68c58046..3759be37b8830ececee270c212a99d1a03f8b9fa 100755 (executable)
@@ -902,6 +902,8 @@ sub git_get_projects_list {
        if (-d $projects_list) {
                # search in directory
                my $dir = $projects_list;
+               # remove the trailing "/"
+               $dir =~ s!/+$!!;
                my $pfxlen = length("$dir");
 
                File::Find::find({