about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-24 14:23:30 +0500
committerEric Wong <e@80x24.org>2021-03-24 23:01:18 +0000
commitd33f1ef680f2e7bce511f1e18d6bb5b24650e17b (patch)
tree2367fe200d836a6e052ffb1bc99e05db6d8d31ef
parent954eb66a5bcf5447cec47bb89f4afd99a5952891 (diff)
downloadpublic-inbox-d33f1ef680f2e7bce511f1e18d6bb5b24650e17b.tar.gz
This is necessary for lei->rel2abs correctness, and may
eventually be useful if we can use *at syscalls.
-rw-r--r--lib/PublicInbox/LEI.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index ee991f80..74372532 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -640,6 +640,11 @@ sub dispatch {
                                 next if $d eq ''; # same as git(1)
                                 chdir $d or return fail($self, "cd $d: $!");
                         }
+                        if (delete $self->{3}) { # update cwd for rel2abs
+                                opendir my $dh, '.' or
+                                        return fail($self, "opendir . $!");
+                                $self->{3} = $dh;
+                        }
                 }
                 $cb->($self, @argv);
         } elsif (grep(/\A-/, $cmd, @argv)) { # --help or -h only