From: Jakub Narebski Date: Thu, 28 Jul 2011 21:38:03 +0000 (+0200) Subject: gitweb: Git config keys are case insensitive, make config search too X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/8a58a0170c3587ba5607f28de097fc6a474900193e5838f3858073f0ea6858dd gitweb: Git config keys are case insensitive, make config search too "git config -z -l" that gitweb uses in git_parse_project_config() to populate %config hash returns section and key names of config variables in lowercase (they are case insensitive). When checking %config in git_get_project_config() we have to take it into account. Helped-by: Junio C Hamano Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index e0d2365..349c969 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -2527,6 +2527,13 @@ sub git_get_project_config { # key sanity check return unless ($key); + # only subsection, if exists, is case sensitive, + # and not lowercased by 'git config -z -l' + if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) { + $key = join(".", lc($hi), $mi, lc($lo)); + } else { + $key = lc($key); + } $key =~ s/^gitweb\.//; return if ($key =~ m/\W/);