diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-02-14 03:29:01 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-02-14 03:29:01 +0000 |
commit | 4aecb5b5cac31fffe9c189363ef05e3582c40547 (patch) | |
tree | e026e20d487e196724effdedec1034b10d1a5018 /lib/Cwd.pm | |
parent | b1281dbe76784daea74f915549beb077eba27d37 (diff) | |
download | perl-4aecb5b5cac31fffe9c189363ef05e3582c40547.tar.gz |
More MacOS Classic fixes from Chris Nandor.
p4raw-id: //depot/perl@8805
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r-- | lib/Cwd.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 4a263cd5fa..f27bd3a12b 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -91,7 +91,7 @@ sub _backtick_pwd { unless(defined &cwd) { # The pwd command is not available in some chroot(2)'ed environments - if(grep { -x "$_/pwd" } split(':', $ENV{PATH})) { + if($^O eq 'MacOS' || grep { -x "$_/pwd" } split(':', $ENV{PATH})) { *cwd = \&_backtick_pwd; } else { @@ -198,6 +198,9 @@ sub chdir { if ($^O eq 'VMS') { return $ENV{'PWD'} = $ENV{'DEFAULT'} } + elsif ($^O eq 'MacOS') { + return $ENV{'PWD'} = cwd(); + } elsif ($^O eq 'MSWin32') { $ENV{'PWD'} = Win32::GetFullPathName($newdir); return 1; @@ -417,6 +420,12 @@ sub _epoc_cwd { *fastcwd = \&_epoc_cwd; *abs_path = \&fast_abs_path; } + elsif ($^O eq 'MacOS') { + *getcwd = \&cwd; + *fastgetcwd = \&cwd; + *fastcwd = \&cwd; + *abs_path = \&fast_abs_path; + } } # package main; eval join('',<DATA>) || die $@; # quick test |