Ok if i have
$projects_list = "/a/git////" ==> ending "/" . the function will fail at check_export_ok()
That is because we get the $pfxlen wrong. We should ignore all the trailing "/" my $subdir = substr($File::Find::name, $pfxlen + 1);
threads / discuss / 43296
Subject: git_get_projects_list and $projects_list
Ok if i have
$projects_list = "/a/git////" ==> ending "/" . the function will fail at check_export_ok()
That is because we get the $pfxlen wrong. We should ignore all the trailing "/" my $subdir = substr($File::Find::name, $pfxlen + 1);
Re: git_get_projects_list and $projects_list
Aneesh Kumar wrote:
> Ok if i have > > $projects_list = "/a/git////" ==> ending "/" . the function will fail > at check_export_ok() > > That is because we get the $pfxlen wrong. We should ignore all the trailing "/" > my $subdir = substr($File::Find::name, $pfxlen + 1);
Perhaps it would be enough to just add
$dir =~ s!/+$//;
before
my $pfxlen = length("$dir");
(or something equivalent). Try it and send us a patch.-- Jakub Narebski Warsaw, Poland ShadeHawk on #git
Re: git_get_projects_list and $projects_list
Jakub Narebski wrote:
> Aneesh Kumar wrote: > >> Ok if i have >> >> $projects_list = "/a/git////" ==> ending "/" . the function will fail >> at check_export_ok() >> >> That is because we get the $pfxlen wrong. We should ignore all the trailing "/" >> my $subdir = substr($File::Find::name, $pfxlen + 1); > > Perhaps it would be enough to just add > $dir =~ s!/+$//;
Ooops, it should of course be
$dir =~ s!/+$!!;
> before
> my $pfxlen = length("$dir");
> (or something equivalent). Try it and send us a patch.-- Jakub Narebski Warsaw, Poland ShadeHawk on #git
Re: git_get_projects_list and $projects_list
On 10/31/06, Jakub Narebski <jnareb@gmail.com> wrote:
> $dir =~ s!/+$!!; >
That works. Attaching the diff below
-aneesh
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index bf5f829..4343450 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -897,6 +897,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({