X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCwd.pm;h=7eb0cf5ba0d9fc012b6ae8f2cacd4afe2d3a8aa8;hb=031444c208a641407a9c485b4619db54f43e6b7f;hp=fa5948c43606f3e6c9f3111376a21a5e66998535;hpb=81a4c762684cf629f6e7986fe1827ecd2af35ba2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Cwd.pm b/lib/Cwd.pm index fa5948c..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.22'; +$VERSION = '3.24_01'; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); @@ -479,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'}); @@ -658,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'}; }