Epoc update
[p5sagit/p5-mst-13.2.git] / lib / Cwd.pm
index 1e544d9..dbeae69 100644 (file)
@@ -180,7 +180,7 @@ sub chdir_init {
 }
 
 sub chdir {
-    my $newdir = shift || '';  # allow for no arg (chdir to HOME dir)
+    my $newdir = @? ? shift : '';      # allow for no arg (chdir to HOME dir)
     $newdir =~ s|///*|/|g unless $^O eq 'MSWin32';
     chdir_init() unless $chdir_init;
     return 0 unless CORE::chdir $newdir;
@@ -271,7 +271,7 @@ sub abs_path
 
 sub fast_abs_path {
     my $cwd = getcwd();
-    my $path = shift || '.';
+    my $path = @_ ? shift : '.';
     CORE::chdir($path) || croak "Cannot chdir to $path:$!";
     my $realpath = getcwd();
     CORE::chdir($cwd)  || croak "Cannot chdir back to $cwd:$!";
@@ -340,12 +340,17 @@ sub _qnx_cwd {
 }
 
 sub _qnx_abs_path {
-    my $path = shift || '.';
+    my $path = @_ ? shift : '.';
     my $realpath=`/usr/bin/fullpath -t $path`;
     chop $realpath;
     return $realpath;
 }
 
+sub _epoc_cwd {
+    $ENV{'PWD'} = EPOC::getcwd();
+    return $ENV{'PWD'};
+}
+
 {
     no warnings;       # assignments trigger 'subroutine redefined' warning
 
@@ -394,6 +399,12 @@ sub _qnx_abs_path {
         *fastcwd       = \&cwd;
         *abs_path      = \&fast_abs_path;
     }
+    elsif ($^O eq 'epoc') {
+        *getcwd        = \&_epoc_cwd;
+        *fastgetcwd    = \&_epoc_cwd;
+        *fastcwd       = \&_epoc_cwd;
+        *abs_path      = \&fast_abs_path;
+    }
 }
 
 # package main; eval join('',<DATA>) || die $@;        # quick test