diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-05-15 06:17:04 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-05-15 06:17:04 +0000 |
commit | f6c18ff1fbcca24d301fa24a27ca9222faf9ceaa (patch) | |
tree | 8a0b161395aae3cc24d45b196ca16a748d8c488e /lib/Cwd.pm | |
parent | 9c7d862108a3f02f3db65204f8154cdfe689040e (diff) | |
download | perl-f6c18ff1fbcca24d301fa24a27ca9222faf9ceaa.tar.gz |
perl 5.003_01: lib/Cwd.pm
Don't reduce '/' to empty string
Improved support for Win32
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r-- | lib/Cwd.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm index bee2e179ae..1512d7f212 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; |