From: pcanterino <> Date: Mon, 13 Oct 2003 17:35:48 +0000 (+0000) Subject: check_path() was cleaned up. It now uses upper_path() and file_name() instead of... X-Git-Tag: version_1_1~9 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/258ec0b29f3b69680b6de4ddc9704c3710a50178 check_path() was cleaned up. It now uses upper_path() and file_name() instead of fileparse(). --- diff --git a/modules/Tool.pm b/modules/Tool.pm index a37967e..9e89e43 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 10-03-2003 +# Last modified: 2003-10-03 # use strict; @@ -14,7 +14,6 @@ use strict; use vars qw(@EXPORT); use Cwd qw(abs_path); -use File::Basename; use File::Spec; ### Export ### @@ -54,17 +53,11 @@ sub check_path($$) # The path points to a file # We have to extract the directory name and create the absolute path - my @pathinfo = fileparse($path); + my $dir = upper_path($path); + my $file = file_name($path); - # This is only to avoid errors - - my $basename = $pathinfo[0] || ''; - my $dir = $pathinfo[1] || ''; - my $ext = $pathinfo[2] || ''; - - $dir = abs_path($dir); - - $path = $dir."/".$basename.$ext; + $dir = abs_path($dir); + $path = $dir."/".$file; } else {