X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/631d1131d6d3a3c2903f92bb3593c62d6b7d9c90..e229c0feaa828e8255bda950ed3456ef196226b3:/dist/PathTools/lib/File/Spec.pm diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm index f416908..954a01d 100644 --- a/dist/PathTools/lib/File/Spec.pm +++ b/dist/PathTools/lib/File/Spec.pm @@ -1,16 +1,14 @@ package File::Spec; use strict; -use vars qw(@ISA $VERSION); -$VERSION = '3.60'; +our $VERSION = '3.70'; $VERSION =~ tr/_//d; -my %module = (MacOS => 'Mac', +my %module = ( MSWin32 => 'Win32', os2 => 'OS2', VMS => 'VMS', - epoc => 'Epoc', NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare. symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian. dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP. @@ -21,7 +19,7 @@ my %module = (MacOS => 'Mac', my $module = $module{$^O} || 'Unix'; require "File/Spec/$module.pm"; -@ISA = ("File::Spec::$module"); +our @ISA = ("File::Spec::$module"); 1; @@ -158,10 +156,13 @@ Returns a string representation of the parent directory. =item no_upwards -Given a list of file names, strip out those that refer to a parent -directory. (Does not strip symlinks, only '.', '..', and equivalents.) +Given a list of files in a directory (such as from C), +strip out C<'.'> and C<'..'>. - @paths = File::Spec->no_upwards( @paths ); +B This does NOT filter paths containing C<'..'>, like +C<'../../../../etc/passwd'>, only literal matches to C<'.'> and C<'..'>. + + @paths = File::Spec->no_upwards( readdir $dirhandle ); =item case_tolerant