X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FLeiLcat.pm;h=191f6f244857221d0086db1b0548d64ed35b2c8a;hb=7893b78fd691ef1e9b503e44174ff53278b02554;hp=d553b18733da5a267845e7b142b73b10aad07d75;hpb=13e60633b0a4fd31f224bf172c976e8d921ec609;p=public-inbox.git diff --git a/lib/PublicInbox/LeiLcat.pm b/lib/PublicInbox/LeiLcat.pm index d553b187..191f6f24 100644 --- a/lib/PublicInbox/LeiLcat.pm +++ b/lib/PublicInbox/LeiLcat.pm @@ -124,18 +124,15 @@ could not extract Message-ID from $x sub _stdin { # PublicInbox::InputPipe::consume callback for --stdin my ($lei) = @_; # $_[1] = $rbuf - if (defined($_[1])) { - $_[1] eq '' and return eval { - $lei->fchdir or return; - my @argv = split(/\s+/, $lei->{mset_opt}->{qstr}); - $lei->{mset_opt}->{qstr} = extract_all($lei, @argv) - or return; - $lei->_start_query; - }; - $lei->{mset_opt}->{qstr} .= $_[1]; - } else { - $lei->fail("error reading stdin: $!"); - } + $_[1] // return $lei->fail("error reading stdin: $!"); + return $lei->{mset_opt}->{qstr} .= $_[1] if $_[1] ne ''; + eval { + $lei->fchdir; + my @argv = split(/\s+/, $lei->{mset_opt}->{qstr}); + $lei->{mset_opt}->{qstr} = extract_all($lei, @argv) or return; + $lei->_start_query; + }; + $lei->fail($@) if $@; } sub lei_lcat {