Integrate perlio:
[p5sagit/p5-mst-13.2.git] / lib / Cwd.pm
index 680fc3e..63a14fd 100644 (file)
@@ -188,8 +188,9 @@ $pwd_cmd ||= 'pwd';
 # The 'natural and safe form' for UNIX (pwd may be setuid root)
 sub _backtick_pwd {
     my $cwd = `$pwd_cmd`;
-    # `pwd` may fail e.g. if the disk is full
+    # Belt-and-suspenders in case someone said "undef $/".
     local $/ = "\n";
+    # `pwd` may fail e.g. if the disk is full
     chomp($cwd) if defined $cwd;
     $cwd;
 }
@@ -465,12 +466,18 @@ sub _dos_cwd {
 }
 
 sub _qnx_cwd {
+       local $ENV{PATH} = '';
+       local $ENV{CDPATH} = '';
+       local $ENV{ENV} = '';
     $ENV{'PWD'} = `/usr/bin/fullpath -t`;
     chop $ENV{'PWD'};
     return $ENV{'PWD'};
 }
 
 sub _qnx_abs_path {
+       local $ENV{PATH} = '';
+       local $ENV{CDPATH} = '';
+       local $ENV{ENV} = '';
     my $path = @_ ? shift : '.';
     my $realpath=`/usr/bin/fullpath -t $path`;
     chop $realpath;