Skip to content

Commit

Permalink
gitweb: text files for 'blob_plain' action without charset by default
Browse files Browse the repository at this point in the history
$default_text_plain_charset is undefined (no specified charset) by
default. Additionally ':raw' layer for binmode is used for outputting file
content.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Jun 19, 2006
1 parent f5aa79d commit ad14e93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitweb/gitweb.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ my $projects_list = "index/index.aux";

# default blob_plain mimetype and default charset for text/plain blob
my $default_blob_plain_mimetype = 'text/plain';
my $default_text_plain_charset = 'utf-8'; # can be undefined
my $default_text_plain_charset = undef;

# input validation and dispatch
my $action = $cgi->param('a');
Expand Down Expand Up @@ -1523,9 +1523,9 @@ sub git_blob_plain {

print $cgi->header(-type => "$type", '-content-disposition' => "inline; filename=\"$save_as\"");
undef $/;
binmode STDOUT, ':raw' unless $type =~ m/^text\//;
binmode STDOUT, ':raw';
print <$fd>;
binmode STDOUT, ':utf8' unless $type =~ m/^text\//;
binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
$/ = "\n";
close $fd;
}
Expand Down

0 comments on commit ad14e93

Please sign in to comment.