1N/A chdir 't' if -d 't'; 1N/A# XXX force Cwd to bootsrap its XSUBs since we have set @INC = "../lib" 1N/A# XXX and subsequent chdir()s can make them impossible to find 1N/A# Must find an external pwd (or equivalent) command. 1N/A # Win32's cd returns native C:\ style 1N/A # DCL SHOW DEFAULT has leading spaces 1N/A # Darwin's getcwd(3) (which Cwd.xs:bsd_realpath() uses which 1N/A # Cwd.pm:getcwd uses) has some magic related to the PWD 1N/A # environment variable: if PWD is set to a directory that 1N/A # looks about right (guess: has the same (dev,ino) as the '.'?), 1N/A # the PWD is returned. However, if that path contains 1N/A # symlinks, the path will not be equal to the one returned by 1N/A # /bin/pwd (which probably uses the usual walking upwards in 1N/A # the path -trick). This situation is easy to reproduce since 1N/A # the PWD to force getcwd(3) to (re)compute the cwd in full. 1N/A # Admittedly fixing this in the Cwd module would be better 1N/A # long-term solution but deleting $ENV{PWD} should not be 1N/A # done light-heartedly. --jhi 1N/A# Cwd::chdir should also update $ENV{PWD} 1N/A############################################# 1N/A# These two routines give us sort of a poor-man's cross-platform 1N/A# directory comparison routine.