---
 lib/PublicInbox/TestCommon.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 465d4b9d..2627871a 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -288,9 +288,12 @@ sub run_script ($;$$) {
        }
        if ($run_mode == 0) {
                # spawn an independent new process, like real-world use cases:
-               $spawn_opt->{$_} = $opt->{$_} for (qw(-C));
                require PublicInbox::Spawn;
                my $cmd = [ key2script($key), @argv ];
+               if (my $d = $opt->{'-C'}) {
+                       $cmd->[0] = File::Spec->rel2abs($cmd->[0]);
+                       $spawn_opt->{'-C'} = $d;
+               }
                my $pid = PublicInbox::Spawn::spawn($cmd, $env, $spawn_opt);
                if (defined $pid) {
                        my $r = waitpid($pid, 0) // die "waitpid: $!";
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to