diff options
author | Eric Wong <e@80x24.org> | 2019-11-15 09:50:42 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-11-16 11:05:23 +0000 |
commit | 2df8cfd320dc9efdf3c2764b2c60ec457c1b024f (patch) | |
tree | 1be2a822a044affbf40cc916c708984bf5429df1 /lib | |
parent | b05207350b218972fc7614c75b49eaae26f9013a (diff) | |
download | public-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')
-rw-r--r-- | lib/PublicInbox/Spawn.pm | 2 |
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; |