diff options
author | Eric Wong <e@80x24.org> | 2023-11-13 13:15:41 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-13 21:55:00 +0000 |
commit | 2d3699d2ce8cbee21485c8b31b1f681d2bb5def5 (patch) | |
tree | 675eea9a3c112b7cf584295cac2e62fae489c9c1 /lib/PublicInbox/Gcf2.pm | |
parent | c560ab9e67476ce7b4438f8323d8ae9e775e790e (diff) | |
download | public-inbox-2d3699d2ce8cbee21485c8b31b1f681d2bb5def5.tar.gz |
read_all can be expanded to support FIFOs/pipes/sockets where read-until-EOF behavior is desired. We can also rely on wantarray to support splitting on EOL markers, but it's hard-coded to support only `$/ eq "\n"' since (AFAIK) it's the only way we use the wantarray form `readline'.
Diffstat (limited to 'lib/PublicInbox/Gcf2.pm')
-rw-r--r-- | lib/PublicInbox/Gcf2.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/Gcf2.pm b/lib/PublicInbox/Gcf2.pm index 5490049d..e0219b55 100644 --- a/lib/PublicInbox/Gcf2.pm +++ b/lib/PublicInbox/Gcf2.pm @@ -81,8 +81,7 @@ sub add_alt ($$) { # # See https://bugs.debian.org/975607 if (open(my $fh, '<', "$objdir/info/alternates")) { - chomp(my @abs_alt = grep(m!^/!, <$fh>)); - $fh = eof($fh) | close $fh; # detect readline errors + chomp(my @abs_alt = grep m!^/!, PublicInbox::IO::read_all $fh); $gcf2->add_alternate($_) for @abs_alt; } $gcf2->add_alternate($objdir); |