From 55c250a8937ccdd2e600980d5e5812c7267f996e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Mar 2019 21:40:00 +0000 Subject: spawn: support absolute paths cgit (and most other CGI executables) is not typically installed for use via $PATH, so we'll need to support absolute paths to run it. --- lib/PublicInbox/Spawn.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index 8ea255af..202cfcae 100644 --- a/lib/PublicInbox/Spawn.pm +++ b/lib/PublicInbox/Spawn.pm @@ -166,9 +166,9 @@ unless (defined $vfork_spawn) { *pi_fork_exec = *PublicInbox::SpawnPP::pi_fork_exec } -# n.b. we never use absolute paths with this sub which ($) { my ($file) = @_; + return $file if index($file, '/') == 0; foreach my $p (split(':', $ENV{PATH})) { $p .= "/$file"; return $p if -x $p; -- cgit v1.2.3-24-ge0c7