gitweb: Fix bug in insert_file() subroutine

In insert_file() subroutine (which is used to insert HTML fragments as
custom header, footer, hometext (for projects list view), and per
project README.html (for summary view)) we used:

     map(to_utf8, <$fd>);

This doesn't work, and other form has to be used:

     map { to_utf8($_) } <$fd>;

Now with test for t9600 added, for $GIT_DIR/README.html.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jakub Narebski
2008-12-08 14:13:21 +01:00
committed by Junio C Hamano
parent e10ea8126c
commit 4586864afe
2 changed files with 11 additions and 1 deletions

View File

@ -2764,7 +2764,7 @@ sub insert_file {
my $filename = shift;
open my $fd, '<', $filename;
print map(to_utf8, <$fd>);
print map { to_utf8($_) } <$fd>;
close $fd;
}