X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCwd.pm;h=7eb0cf5ba0d9fc012b6ae8f2cacd4afe2d3a8aa8;hb=031444c208a641407a9c485b4619db54f43e6b7f;hp=755c7a77959220706f2f028fd773f9c31e48f425;hpb=ff235dd6d6f5e19e11c9202d4a82fb8e5fbadadd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 755c7a7..7eb0cf5 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -171,7 +171,7 @@ use strict; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); -$VERSION = '3.18'; +$VERSION = '3.24_01'; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); @@ -370,10 +370,8 @@ if ($^O eq 'cygwin') { # isn't redefined later (20001212 rspier) *fastgetcwd = \&cwd; -# By Brandon S. Allbery -# -# Usage: $cwd = getcwd(); - +# A non-XS version of getcwd() - also used to bootstrap the perl build +# process, when miniperl is running and no XS loading happens. sub _perl_getcwd { abs_path('.'); @@ -481,7 +479,9 @@ sub chdir { return 1; } - if ($newdir =~ m#^/#s) { + if (ref $newdir eq 'GLOB') { # in case a file/dir handle is passed in + $ENV{'PWD'} = cwd(); + } elsif ($newdir =~ m#^/#s) { $ENV{'PWD'} = $newdir; } else { my @curdir = split(m#/#,$ENV{'PWD'}); @@ -660,7 +660,12 @@ sub _os2_cwd { } sub _win32_cwd { - $ENV{'PWD'} = Win32::GetCwd(); + if (defined &DynaLoader::boot_DynaLoader) { + $ENV{'PWD'} = Win32::GetCwd(); + } + else { # miniperl + chomp($ENV{'PWD'} = `cd`); + } $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; }