]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Fix bug in insert_file() subroutine
authorJakub Narebski <redacted>
Mon, 8 Dec 2008 13:13:21 +0000 (14:13 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 8d4d14d9caa0789dc6e71be796c24459153f478450c2557b1256495ccfdea21e..912fdfa69185dac27764d081f57dcd834baad4d1dd149b6f1fb1573915b5a56a 100755 (executable)
@@ -2765,7 +2765,7 @@ sub insert_file {
        my $filename = shift;
 
        open my $fd, '<', $filename;
-       print map(to_utf8, <$fd>);
+       print map { to_utf8($_) } <$fd>;
        close $fd;
 }
 
This page took 0.319074 seconds and 4 git commands to generate.