From: Eric Wong Date: Sun, 10 Mar 2019 21:40:00 +0000 (+0000) Subject: spawn: support absolute paths X-Git-Tag: v1.2.0~342 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=55c250a8937ccdd2e600980d5e5812c7267f996e;p=public-inbox.git 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. --- 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;