index: silence git read warning
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 8 Mar 2015 06:18:01 +0000 (07:18 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:43 +0000 (05:43 +0200)
> Value of <HANDLE> construct can be "0"; test with defined()

Introduced in v1.6-29-gb733f67373 (2015-02-13) [index: latest git commit].

index.plp

index 53cec8954b6d1db8b3626ff9d8fc56c77cac3529..1bb2d7bf7e3cdec4ca03a78cfb8947c79d2f442c 100644 (file)
--- a/index.plp
+++ b/index.plp
@@ -25,7 +25,8 @@ but you're free to use, print, alter, and redistribute under the AGPL license.
 <:
 my @format = ('--date=short', "--pretty=%ad (%ar)\t%s");
 if (open my $log, '-|', git => 'log', -1, @format) {{
 <:
 my @format = ('--date=short', "--pretty=%ad (%ar)\t%s");
 if (open my $log, '-|', git => 'log', -1, @format) {{
-       my $line = readline $log or next;
+       my $line = readline $log;
+       $line or next;  # explicitly ignore empty input
        my ($date, $subject) = split /[\t\n]/, $line;
        $date =~ s/ \K/<small>/ and $date .= '</small>';
        print "<p><strong>Last update</strong>: $date $subject</p>\n";
        my ($date, $subject) = split /[\t\n]/, $line;
        $date =~ s/ \K/<small>/ and $date .= '</small>';
        print "<p><strong>Last update</strong>: $date $subject</p>\n";