X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/8863cf4b7d0138f789fb2724cd7b28527fe8bb6af0ce2e8e18e22ac8fa16321e..d0fa8ea86735cda28c6687739811e48dfc171aef15f25065fef85d838dab9269:/gitweb.cgi diff --git a/gitweb.cgi b/gitweb.cgi index 35cce31..7c4ba77 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -2,8 +2,8 @@ # gitweb - simple web interface to track changes in git repositories # -# (C) 2005, Kay Sievers -# (C) 2005, Christian Gierke +# (C) 2005-2006, Kay Sievers +# (C) 2005, Christian Gierke # # This program is licensed under the GPLv2 @@ -17,7 +17,7 @@ use Fcntl ':mode'; binmode STDOUT, ':utf8'; my $cgi = new CGI; -my $version = "262"; +my $version = "266"; my $my_url = $cgi->url(); my $my_uri = $cgi->url(-absolute => 1); my $rss_link = ""; @@ -253,7 +253,7 @@ sub git_header_html { - + @@ -404,12 +404,13 @@ sub git_read_head { if (open my $fd, "-|", "$gitbin/git-rev-parse", "--verify", "HEAD") { my $head = <$fd>; close $fd; - chomp $head; - if ($head =~ m/^[0-9a-fA-F]{40}$/) { - $retval = $head; + if (defined $head && $head =~ /^([0-9a-fA-F]{40})$/) { + $retval = $1; } } - $ENV{'GIT_DIR'} = $oENV; + if (defined $oENV) { + $ENV{'GIT_DIR'} = $oENV; + } return $retval; } @@ -786,7 +787,7 @@ sub get_file_owner { } my $owner = $gcos; $owner =~ s/[,;].*$//; - return $owner; + return decode("utf8", $owner, Encode::FB_DEFAULT); } sub git_read_projects { @@ -822,7 +823,7 @@ sub git_read_projects { if (-e "$projectroot/$path/HEAD") { my $pr = { path => $path, - owner => $owner, + owner => decode("utf8", $owner, Encode::FB_DEFAULT), }; push @list, $pr } @@ -1024,7 +1025,7 @@ sub git_summary { $pr = unescape($pr); $ow = unescape($ow); if ($pr eq $project) { - $owner = $ow; + $owner = decode("utf8", $ow, Encode::FB_DEFAULT); last; } } @@ -2122,7 +2123,7 @@ sub git_history { "\n"; print "
/" . esc_html($file_name) . "
\n"; - open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin \'$file_name\'"; + open my $fd, "-|", "$gitbin/git-rev-list $hash | $gitbin/git-diff-tree -r --stdin -- \'$file_name\'"; my $commit; print "\n"; my $alternate = 0;