about summary refs log tree commit homepage
path: root/lib/PublicInbox/Spawn.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-15 09:50:42 +0000
committerEric Wong <e@80x24.org>2019-11-16 11:05:23 +0000
commit2df8cfd320dc9efdf3c2764b2c60ec457c1b024f (patch)
tree1be2a822a044affbf40cc916c708984bf5429df1 /lib/PublicInbox/Spawn.pm
parentb05207350b218972fc7614c75b49eaae26f9013a (diff)
downloadpublic-inbox-2df8cfd320dc9efdf3c2764b2c60ec457c1b024f.tar.gz
This makes the subroutine behave more like which(1) command
and will make using spawn() in tests easier.
Diffstat (limited to 'lib/PublicInbox/Spawn.pm')
-rw-r--r--lib/PublicInbox/Spawn.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index e2868a55..b946a663 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -178,7 +178,7 @@ unless (defined $vfork_spawn) {
 
 sub which ($) {
         my ($file) = @_;
-        return $file if index($file, '/') == 0;
+        return $file if index($file, '/') >= 0;
         foreach my $p (split(':', $ENV{PATH})) {
                 $p .= "/$file";
                 return $p if -x $p;