]> Lady’s Gitweb - Gitweb/commit
gitweb: accept trailing "/" in $project_list
authorMatthieu Moy <redacted>
Wed, 4 Jan 2012 10:07:45 +0000 (11:07 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
commit1ffb8bae6c78d1c4956c899bbe879530523bfb0a9f514522210bb24cbaab4507
tree6439a5bb941ac16a12391d2267c76d0bdd9b1ddbe6415290ed23c9afa1292cc1
parent95e6f705b0d564e9a30ccb71cf131c92ad8cb7af373444ec23892ad17c1b2071
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.325649 seconds and 4 git commands to generate.