X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/2a8ab3c4d1bcb71a93cc7cca5a22dcd00a37e9f00c62b1e8a8b94cf474b7d9ee..a341a1048ae5adee5899af18efc76cb217f080043b5b3b221100063da3b4eec7:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 2efd437..87c50e6 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++"; our $my_url = $cgi->url(); our $my_uri = $cgi->url(-absolute => 1); +# if we're called with PATH_INFO, we have to strip that +# from the URL to find our real URL +if (my $path_info = $ENV{"PATH_INFO"}) { + $my_url =~ s,\Q$path_info\E$,,; + $my_uri =~ s,\Q$path_info\E$,,; +} + # core git executable to use # this can just be "git" if your webserver has a sensible PATH our $GIT = "++GIT_BINDIR++/git"; @@ -776,7 +783,7 @@ sub quot_cec { ); my $chr = ( (exists $es{$cntrl}) ? $es{$cntrl} - : sprintf('\%03o', ord($cntrl)) ); + : sprintf('\%2x', ord($cntrl)) ); if ($opts{-nohtml}) { return $chr; } else {