author | Matthieu Moy <Matthieu.Moy@imag.fr> | |
Wed, 4 Jan 2012 10:07:45 +0000 (11:07 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 4 Jan 2012 17:54:06 +0000 (09:54 -0800) | ||
commit | ac593b76dde42fa8340fb60e7d6fc315a5be7c40 | |
tree | b13135123160433ac9fa679b4e1d02c0170f215e | tree | snapshot |
parent | 12b1443c2cf41174311c81667022c6f3149aa542 | commit | diff |
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>
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>
gitweb/gitweb.perl | diff | blob | history |