]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiQuery.pm
lei_query: fix relative path handling on --stdin
[public-inbox.git] / lib / PublicInbox / LeiQuery.pm
index 7ddba4cf27398603855e56df67416aef52d0645d..385ba0a9b4cad38af59a23913b703344eb05339f 100644 (file)
@@ -53,6 +53,9 @@ sub qstr_add { # PublicInbox::InputPipe::consume callback for --stdin
        my ($self) = @_; # $_[1] = $rbuf
        if (defined($_[1])) {
                $_[1] eq '' and return eval {
+                       if (my $dfd = $self->{3}) {
+                               chdir($dfd) or return $self->fail("fchdir: $!");
+                       }
                        $self->{mset_opt}->{q_raw} = $self->{mset_opt}->{qstr};
                        $self->{lse}->query_approxidate($self->{lse}->git,
                                                $self->{mset_opt}->{qstr});