From dacd47b22374d602709a46ea70930cb43c01a069 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 7 Jan 2004 16:37:30 +0000 Subject: check the name given to whereis_binary() doesn't contain a "/" --- MDK/Common/System.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'MDK/Common') 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; -- cgit v1.2.1