git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Remove extra "/" in path names for git_get_project_list

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 3, 2006, 11:18 UTC
Message-ID
<eif8gd$6u5$1@sea.gmane.org>
In-Reply-To
<7vslh1jcji.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 14 quoted lines
> "Aneesh Kumar K.V" <aneesh.kumar@gmail.com> writes:
> 
>> 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 <aneesh.kumar@gmail.com>
> 
> Hmph.  Doesn't this break $projects_list = "/", I wonder?
> 
>> +            # remove the trailing "/"
>> +            $dir =~ s!/+$!!;
So perhaps
        $dir =~ s!(?<=[^/])/+$!!;
(zero-width positive look-behind assertion).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C Hamano
Message 3 of 3 in “gitweb: Remove extra "/" in path names for git_get_project_list”
  1. gitweb: Remove extra "/" in path names for git_get_project_listAneesh Kumar K.V, Nov 3, 2006
  2. Junio C HamanoNov 3, 2006
  3. Jakub NarebskiNov 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.