diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-01 12:33:44 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-01 12:33:44 +0000 |
commit | 164336fe285a406eec3a30a591ac139619af9e11 (patch) | |
tree | b264101d77ab892bc63738b181fd85b19354893d /ext/Cwd | |
parent | 5e6396ae8c4307a3de4655988c007bee1e933079 (diff) | |
download | perl-164336fe285a406eec3a30a591ac139619af9e11.tar.gz |
OS X test tweak.
p4raw-id: //depot/perl@19374
Diffstat (limited to 'ext/Cwd')
-rw-r--r-- | ext/Cwd/t/cwd.t | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t index 2a8df244f9..834a399b37 100644 --- a/ext/Cwd/t/cwd.t +++ b/ext/Cwd/t/cwd.t @@ -63,6 +63,21 @@ SKIP: { skip("'$pwd_cmd' failed, nothing to test against", 4) if $?; skip("/afs seen, paths unlikely to match", 4) if $start =~ m|/afs/|; + # Darwin's getcwd(3) (which Cwd.xs:bsd_realpath() uses which + # Cwd.pm:getcwd uses) has some magic related to the PWD + # environment variable: if PWD is set to a directory that + # looks about right (guess: has the same (dev,ino) as the '.'?), + # the PWD is returned. However, if that path contains + # symlinks, the path will not be equal to the one returned by + # /bin/pwd (which probably uses the usual walking upwards in + # the path -trick). This situation is easy to reproduce since + # /tmp is a symlink to /private/tmp. Therefore we invalidate + # the PWD to force getcwd(3) to (re)compute the cwd in full. + # Admittedly fixing this in the Cwd module would be better + # long-term solution but deleting $ENV{PWD} should not be + # done light-heartedly. --jhi + delete $ENV{PWD} if $^O eq 'darwin'; + my $cwd = cwd; my $getcwd = getcwd; my $fastcwd = fastcwd; |