From 658c477f1ea4b2f6e6b2370561dbde383a33bdb7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 2 Aug 2004 05:07:48 +0000 Subject: MDK::Common::System: whereis_binary() can now handle prefix --- MDK/Common/System.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MDK/Common') diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm index 22894b3..3b21a9d 100644 --- a/MDK/Common/System.pm +++ b/MDK/Common/System.pm @@ -290,14 +290,14 @@ sub gettimeofday() { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die " sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ } sub whereis_binary { - my ($prog) = @_; + my ($prog, $o_prefix) = @_; if ($prog =~ m!/!) { warn qq(don't call whereis_binary with a name containing a "/" (the culprit is: $prog)\n); return; } foreach (split(':', $ENV{PATH})) { my $f = "$_/$prog"; - -x $f and return $f; + -x "$o_prefix$f" and return $f; } } -- cgit v1.2.1