From: Perl 5 Porters Date: Wed, 15 May 1996 06:17:04 +0000 (+0000) Subject: perl 5.003_01: lib/Cwd.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6c18ff1fbcca24d301fa24a27ca9222faf9ceaa;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_01: lib/Cwd.pm Don't reduce '/' to empty string Improved support for Win32 --- diff --git a/lib/Cwd.pm b/lib/Cwd.pm index bee2e17..1512d7f 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -121,7 +121,7 @@ sub getcwd $cwd = "$dir/$cwd"; closedir(PARENT); } while ($dir); - chop($cwd); # drop the trailing / + chop($cwd) unless $cwd eq '/'; # drop the trailing / $cwd; } @@ -246,12 +246,15 @@ if ($^O eq 'VMS') { *fastcwd = \&_vms_cwd; *fastgetcwd = \&_vms_cwd; } -elsif ($^O eq 'NT') { +elsif ($^O eq 'NT' or $^O eq 'MSWin32') { - *getcwd = \&cwd; - *fastgetcwd = \&cwd; + # We assume that &_NT_cwd is defined as an XSUB or in the core. + *getcwd = \&_NT_cwd; + *fastcwd = \&_NT_cwd; + *fastgetcwd = \&_NT_cwd; } elsif ($^O eq 'os2') { + *cwd = \&_os2_cwd; *getcwd = \&_os2_cwd; *fastgetcwd = \&_os2_cwd;