X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCwd.pm;h=7eb0cf5ba0d9fc012b6ae8f2cacd4afe2d3a8aa8;hb=031444c208a641407a9c485b4619db54f43e6b7f;hp=1a1fd60877c55da11e07ec35253fee41af0797af;hpb=110c90cc4fbd0539c76efe20ae7302af29840848;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 1a1fd60..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.21'; +$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'}; }