summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2012-01-04 10:07:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-04 17:54:06 (GMT)
commitac593b76dde42fa8340fb60e7d6fc315a5be7c40 (patch)
treeb13135123160433ac9fa679b4e1d02c0170f215e /gitweb/gitweb.perl
parent12b1443c2cf41174311c81667022c6f3149aa542 (diff)
downloadgit-ac593b76dde42fa8340fb60e7d6fc315a5be7c40.zip
git-ac593b76dde42fa8340fb60e7d6fc315a5be7c40.tar.gz
git-ac593b76dde42fa8340fb60e7d6fc315a5be7c40.tar.bz2
gitweb: accept trailing "/" in $project_list
The current code is removing the trailing "/", but computing the string length on the previous value, i.e. with the trailing "/". Later in the code, we do my $path = substr($File::Find::name, $pfxlen + 1); And the "$pfxlen + 1" is supposed to mean "the length of the prefix, plus 1 for the / separating the prefix and the path", but with an incorrect $pfxlen, this basically eats the first character of the path, and yields "404 - No projects found". While we're there, also fix $pfxdepth to use $dir, although a change of 1 in the depth shouldn't really matter. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 014b33b..e12ddba 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2661,8 +2661,8 @@ sub git_get_projects_list {
my $dir = $projects_list;
# remove the trailing "/"
$dir =~ s!/+$!!;
- my $pfxlen = length("$projects_list");
- my $pfxdepth = ($projects_list =~ tr!/!!);
+ my $pfxlen = length("$dir");
+ my $pfxdepth = ($dir =~ tr!/!!);
# when filtering, search only given subdirectory
if ($filter) {
$dir .= "/$filter";