X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/6a0432ae8e83df713006409cf8ba6b673ad074e5..f0288c6096cf43b4d5663492f7a51eedc5bf49c9:/modules/Tool.pm?ds=sidebyside diff --git a/modules/Tool.pm b/modules/Tool.pm index acc4722..afffeb3 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 2005-02-12 +# Last modified: 2005-04-22 # use strict; @@ -61,6 +61,7 @@ sub check_path($$) # We extract the last part of the path and create the absolute path my $first = upper_path($path); + $first = File::Spec->canonpath($first); $first = abs_path($first); my $last = file_name($path); @@ -223,7 +224,7 @@ sub file_name($) my $path = shift; $path =~ tr!\\!/!; - unless($path =~ m!^/+$! || ($^O eq 'MSWin32' && $path =~ m!^[a-z]:/+$!)) + unless($path =~ m!^/+$! || ($^O eq 'MSWin32' && $path =~ m!^[a-z]:/+$!i)) { $path =~ s!/+$!!; $path = substr($path,rindex($path,'/')+1); @@ -284,7 +285,7 @@ sub upper_path($) my $path = shift; $path =~ tr!\\!/!; - unless($path =~ m!^/+$! || ($^O eq 'MSWin32' && $path =~ m!^[a-z]:/+$!)) + unless($path =~ m!^/+$! || ($^O eq 'MSWin32' && $path =~ m!^[a-z]:/+$!i)) { $path =~ s!/+$!!; $path = substr($path,0,rindex($path,'/')+1);