Subject: [PATCH 5/7] gitweb: Use 'local $/ = undef;' before 'print <$fd>;'

From: Jakub Narebski <[email-masked]>
Date: Sat, 26 Aug 2006 19:14:24 +0200

Signed-off-by: Jakub Narebski <[email-masked]>
---
 gitweb/gitweb.perl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 093deab..eae83e6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2017,6 +2017,7 @@ sub git_project_list {
 	if (-f $home_text) {
 		print "<div class=\"index_include\">\n";
 		open (my $fd, $home_text);
+		local $/ = undef;
 		print <$fd>;
 		close $fd;
 		print "</div>\n";
@@ -2395,11 +2396,10 @@ sub git_blob_plain {
 
 	print $cgi->header(-type => "$type",
 	                   -content_disposition => "inline; filename=\"$save_as\"");
-	undef $/;
 	binmode STDOUT, ':raw';
+	local $/ = undef;
 	print <$fd>;
 	binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
-	$/ = "\n";
 	close $fd;
 }
 
@@ -2585,6 +2585,7 @@ sub git_snapshot {
 	open my $fd, "-|", "$GIT tar-tree $hash \'$project\' | $command" or
 		die_error(undef, "Execute git-tar-tree failed.");
 	binmode STDOUT, ':raw';
+	local $/ = undef;
 	print <$fd>;
 	binmode STDOUT, ':utf8'; # as set at the beginning of gitweb.cgi
 	close $fd;
-- 
1.4.1.1