about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-17 23:37:52 +0000
committerEric Wong <e@80x24.org>2023-10-18 20:50:24 +0000
commit19b791f4894efcb6e545a6b51c8147298363358f (patch)
tree16a806fcb0c8fdaef242a2d268a8b1416809b46f /lib/PublicInbox/WWW.pm
parent35b0f7aa00a24f5d89b1b941ec644327ba074c99 (diff)
downloadpublic-inbox-19b791f4894efcb6e545a6b51c8147298363358f.tar.gz
`readline' ops may not detect errors on partial reads.
This saves us some code to reduce cognitive overhead for
readers.  We'll also support reusing a destination buffers so it
can work more nicely with existing code.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index 9919f975..86fd7e22 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -587,9 +587,9 @@ sub stylesheets_prepare ($$) {
                                 next;
                         };
                         my $ctime = 0;
-                        my $local = do { local $/; <$fh> };
+                        my $local = read_all($fh, -s $fh);
                         if ($local =~ /\S/) {
-                                $ctime = sprintf('%x',(stat($fh))[10]);
+                                $ctime = sprintf('%x',(stat(_))[10]);
                                 $local = $mini->($local);
                         }