From: Jakub Narebski Date: Wed, 13 Oct 2010 11:33:48 +0000 (+0200) Subject: gitweb: Fix bug in evaluate_path_info X-Git-Tag: v1.7.4-rc0~179 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e00dc58d14a5f8ea229e5a0acf5f019028e3a40;p=git.git gitweb: Fix bug in evaluate_path_info There was bug in parsing "project/:/file" and "project/:/" path_info URLs, with implicit HEAD as 'hash_base'. For such URLs the refname is empty, and before this fix regexp for parsing path_info fragment assumed that it is always non-empty. Refname cannot contain ':', as per 'git check-ref-format'. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index e5910ce8f..c4d3e0846 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -780,10 +780,10 @@ sub evaluate_path_info { 'history', ); - # we want to catch + # we want to catch, among others # [$hash_parent_base[:$file_parent]..]$hash_parent[:$file_name] my ($parentrefname, $parentpathname, $refname, $pathname) = - ($path_info =~ /^(?:(.+?)(?::(.+))?\.\.)?(.+?)(?::(.+))?$/); + ($path_info =~ /^(?:(.+?)(?::(.+))?\.\.)?([^:]+?)?(?::(.+))?$/); # first, analyze the 'current' part if (defined $pathname) {