diff options
author | Tony Cook <tony@develop-help.com> | 2019-03-26 14:23:53 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-04-15 09:26:29 +1000 |
commit | 0a4d1779402e8824dd675302ad6a1914ea6ccf23 (patch) | |
tree | 534a63477709dc5f6c2bf9b170663975c21d75c0 /dist/PathTools | |
parent | 15f67d146cf1f32504e8a11de3faa2abc0f467cd (diff) | |
download | perl-0a4d1779402e8824dd675302ad6a1914ea6ccf23.tar.gz |
(perl #133951) fallback to the built-in getcwd if we can
Diffstat (limited to 'dist/PathTools')
-rw-r--r-- | dist/PathTools/Cwd.pm | 6 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/AmigaOS.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Cygwin.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Epoc.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Functions.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Mac.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/OS2.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Unix.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/VMS.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/lib/File/Spec/Win32.pm | 2 | ||||
-rw-r--r-- | dist/PathTools/t/cwd.t | 11 |
12 files changed, 25 insertions, 12 deletions
diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm index ff0d01d95a..ec3ad5ab45 100644 --- a/dist/PathTools/Cwd.pm +++ b/dist/PathTools/Cwd.pm @@ -3,7 +3,7 @@ use strict; use Exporter; -our $VERSION = '3.77'; +our $VERSION = '3.78'; my $xs_version = $VERSION; $VERSION =~ tr/_//d; @@ -659,6 +659,10 @@ if (exists $METHOD_MAP{$^O}) { } } +# built-in from 5.30 +*getcwd = \&Internals::getcwd + if !defined &getcwd && defined &Internals::getcwd; + # In case the XS version doesn't load. *abs_path = \&_perl_abs_path unless defined &abs_path; *getcwd = \&_perl_getcwd unless defined &getcwd; diff --git a/dist/PathTools/lib/File/Spec.pm b/dist/PathTools/lib/File/Spec.pm index 3e203173a6..7fe3272721 100644 --- a/dist/PathTools/lib/File/Spec.pm +++ b/dist/PathTools/lib/File/Spec.pm @@ -2,7 +2,7 @@ package File::Spec; use strict; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; my %module = ( diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm b/dist/PathTools/lib/File/Spec/AmigaOS.pm index 51210e69a1..2b7d18a85f 100644 --- a/dist/PathTools/lib/File/Spec/AmigaOS.pm +++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm @@ -3,7 +3,7 @@ package File::Spec::AmigaOS; use strict; require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/lib/File/Spec/Cygwin.pm b/dist/PathTools/lib/File/Spec/Cygwin.pm index de401b613a..d44ced3d63 100644 --- a/dist/PathTools/lib/File/Spec/Cygwin.pm +++ b/dist/PathTools/lib/File/Spec/Cygwin.pm @@ -3,7 +3,7 @@ package File::Spec::Cygwin; use strict; require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/lib/File/Spec/Epoc.pm b/dist/PathTools/lib/File/Spec/Epoc.pm index 264bbc83b3..b611cd9f64 100644 --- a/dist/PathTools/lib/File/Spec/Epoc.pm +++ b/dist/PathTools/lib/File/Spec/Epoc.pm @@ -2,7 +2,7 @@ package File::Spec::Epoc; use strict; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; require File::Spec::Unix; diff --git a/dist/PathTools/lib/File/Spec/Functions.pm b/dist/PathTools/lib/File/Spec/Functions.pm index 0816bb0c99..3f617bdd36 100644 --- a/dist/PathTools/lib/File/Spec/Functions.pm +++ b/dist/PathTools/lib/File/Spec/Functions.pm @@ -3,7 +3,7 @@ package File::Spec::Functions; use File::Spec; use strict; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; require Exporter; diff --git a/dist/PathTools/lib/File/Spec/Mac.pm b/dist/PathTools/lib/File/Spec/Mac.pm index 42406aa7df..d920d2f5db 100644 --- a/dist/PathTools/lib/File/Spec/Mac.pm +++ b/dist/PathTools/lib/File/Spec/Mac.pm @@ -4,7 +4,7 @@ use strict; use Cwd (); require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/lib/File/Spec/OS2.pm b/dist/PathTools/lib/File/Spec/OS2.pm index f91ec60c54..603781aa85 100644 --- a/dist/PathTools/lib/File/Spec/OS2.pm +++ b/dist/PathTools/lib/File/Spec/OS2.pm @@ -4,7 +4,7 @@ use strict; use Cwd (); require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/lib/File/Spec/Unix.pm b/dist/PathTools/lib/File/Spec/Unix.pm index 591846b53e..6749e6047c 100644 --- a/dist/PathTools/lib/File/Spec/Unix.pm +++ b/dist/PathTools/lib/File/Spec/Unix.pm @@ -3,7 +3,7 @@ package File::Spec::Unix; use strict; use Cwd (); -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; =head1 NAME diff --git a/dist/PathTools/lib/File/Spec/VMS.pm b/dist/PathTools/lib/File/Spec/VMS.pm index 1e13ac64e7..6c20fb1922 100644 --- a/dist/PathTools/lib/File/Spec/VMS.pm +++ b/dist/PathTools/lib/File/Spec/VMS.pm @@ -4,7 +4,7 @@ use strict; use Cwd (); require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/lib/File/Spec/Win32.pm b/dist/PathTools/lib/File/Spec/Win32.pm index a4ddca80e7..5934010439 100644 --- a/dist/PathTools/lib/File/Spec/Win32.pm +++ b/dist/PathTools/lib/File/Spec/Win32.pm @@ -5,7 +5,7 @@ use strict; use Cwd (); require File::Spec::Unix; -our $VERSION = '3.77'; +our $VERSION = '3.78'; $VERSION =~ tr/_//d; our @ISA = qw(File::Spec::Unix); diff --git a/dist/PathTools/t/cwd.t b/dist/PathTools/t/cwd.t index 483b4378d5..c05693880e 100644 --- a/dist/PathTools/t/cwd.t +++ b/dist/PathTools/t/cwd.t @@ -10,6 +10,7 @@ chdir 't'; use Config; use File::Spec; use File::Path; +use Errno qw(EACCES); use lib File::Spec->catdir('t', 'lib'); use Test::More; @@ -208,7 +209,15 @@ SKIP: { like($abs_path, qr|$want$|i, "Cwd::abs_path produced $abs_path"); like($fast_abs_path, qr|$want$|i, "Cwd::fast_abs_path produced $fast_abs_path"); - like($pas, qr|$want$|i, "Cwd::_perl_abs_path produced $pas") if $EXTRA_ABSPATH_TESTS; + if ($EXTRA_ABSPATH_TESTS) { + # _perl_abs_path() can fail if some ancestor directory isn't readable + if (defined $pas) { + like($pas, qr|$want$|i, "Cwd::_perl_abs_path produced $pas"); + } + else { + is($!+0, EACCES, "check we got the expected error on failure"); + } + } rmtree($test_dirs[0], 0, 0); 1 while unlink $file; |