summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-07 16:37:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-07 16:37:30 +0000
commitdacd47b22374d602709a46ea70930cb43c01a069 (patch)
treef1e8b0b37f9ff7da440e661bebee7fc1b0ec91bf
parent57035179187542b3c57ce162d61d72bccb552bb4 (diff)
downloadperl-MDK-Common-dacd47b22374d602709a46ea70930cb43c01a069.tar
perl-MDK-Common-dacd47b22374d602709a46ea70930cb43c01a069.tar.gz
perl-MDK-Common-dacd47b22374d602709a46ea70930cb43c01a069.tar.bz2
perl-MDK-Common-dacd47b22374d602709a46ea70930cb43c01a069.tar.xz
perl-MDK-Common-dacd47b22374d602709a46ea70930cb43c01a069.zip
check the name given to whereis_binary() doesn't contain a "/"
-rw-r--r--MDK/Common/System.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm
index 5ecdc86..d8fa388 100644
--- a/MDK/Common/System.pm
+++ b/MDK/Common/System.pm
@@ -291,6 +291,10 @@ sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ }
sub whereis_binary {
my ($prog) = @_;
+ if ($prog =~ m!/!) {
+ warn "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;