@matheusbsbs / matheus-bagliano / commits / ad14e93175
Fork 0

gitweb: text files for 'blob_plain' action without charset by default

$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>

Jakub Narebski committed Jun 17, 2006 at 18:07 UTC ad14e9317513f132293406e570f0b9360704371e
1 file changed +3 -3
gitweb/gitweb.cgi
+3 -3
@@ -47,7 +47,7 @@ my $projects_list = "index/index.aux";
47
48 # default blob_plain mimetype and default charset for text/plain blob
49 my $default_blob_plain_mimetype = 'text/plain';
50 -my $default_text_plain_charset = 'utf-8'; # can be undefined
50 +my $default_text_plain_charset = undef;
51
52 # input validation and dispatch
53 my $action = $cgi->param('a');
@@ -1523,9 +1523,9 @@ sub git_blob_plain {
1523
1524 print $cgi->header(-type => "$type", '-content-disposition' => "inline; filename=\"$save_as\"");
1525 undef $/;
1526 - binmode STDOUT, ':raw' unless $type =~ m/^text\//;
1526 + binmode STDOUT, ':raw';
1527 print <$fd>;
1528 - binmode STDOUT, ':utf8' unless $type =~ m/^text\//;
1528 + binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
1529 $/ = "\n";
1530 close $fd;
1531 }