]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Remove extra "/" in path names for git_get_project_list
authorAneesh Kumar K.V <redacted>
Fri, 3 Nov 2006 05:11:45 +0000 (10:41 +0530)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index c2c296ebb2d8d8d9966d65395d30409c7b51dd8198ffdccd73df8e60a358e185..d8b50debf19167cf2d4ec10c2885dd8990aed908d693670e261b15f23d8bf56d 100755 (executable)
@@ -923,6 +923,8 @@ sub git_get_projects_list {
        if (-d $projects_list) {
                # search in directory
                my $dir = $projects_list . ($filter ? "/$filter" : '');
+               # remove the trailing "/"
+               $dir =~ s!/+$!!;
                my $pfxlen = length("$dir");
 
                my $check_forks = gitweb_check_feature('forks');
This page took 0.312926 seconds and 4 git commands to generate.