--stdin usage means the current request can be delayed
indefinitely while other requests with different %ENV
come in. So make sure our warnings and %ENV can match
non-stdin behavior.
This probably fix segfaults during process cleanup on OpenBSD
since _lei_atfork_child use non-localized assignment of
$current_lei. But it could be another red herring. Either way,
it's the right thing to do from an environment replication
perspective.
my ($lei) = @_; # $_[1] = $rbuf
if (defined $_[1]) {
$_[1] eq '' and return eval {
+ $lei->fchdir;
+ local %ENV = %{$lei->{env}};
+ local $PublicInbox::LEI::current_lei = $lei;
my $str = delete $lei->{istr};
$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
my $eml = PublicInbox::Eml->new(\$str);
return $lei->{mset_opt}->{qstr} .= $_[1] if $_[1] ne '';
eval {
$lei->fchdir;
+ local %ENV = %{$lei->{env}};
+ local $PublicInbox::LEI::current_lei = $lei;
my @argv = split(/\s+/, $lei->{mset_opt}->{qstr});
$lei->{mset_opt}->{qstr} = extract_all($lei, @argv) or return;
$lei->_start_query;
return $lei->{mset_opt}->{qstr} .= $_[1] if $_[1] ne '';
eval {
$lei->fchdir;
+ local %ENV = %{$lei->{env}};
+ local $PublicInbox::LEI::current_lei = $lei;
$lei->{mset_opt}->{q_raw} = $lei->{mset_opt}->{qstr};
$lei->{lse}->query_approxidate($lei->{lse}->git,
$lei->{mset_opt}->{qstr});