[patch sv.c] comment fix
[p5sagit/p5-mst-13.2.git] / lib / Cwd.pm
index af0c47f..febd296 100644 (file)
@@ -1,5 +1,5 @@
 package Cwd;
-$VERSION = $VERSION = '2.18';
+$VERSION = $VERSION = '3.01';
 
 =head1 NAME
 
@@ -469,7 +469,8 @@ sub _perl_abs_path(;$)
         my ($dir, $file) = $start =~ m{^(.*)/(.+)$}
            or return cwd() . '/' . $start;
        
-       if (-l _) {
+       # Can't use "-l _" here, because the previous stat was a stat(), not an lstat().
+       if (-l $start) {
            my $link_target = readlink($start);
            die "Can't resolve link $start: $!" unless defined $link_target;
            
@@ -597,11 +598,11 @@ sub _vms_cwd {
 
 sub _vms_abs_path {
     return $ENV{'DEFAULT'} unless @_;
+
+    # may need to turn foo.dir into [.foo]
     my $path = VMS::Filespec::pathify($_[0]);
-    if (! defined $path)
-       {
-       _croak("Invalid path name $_[0]")
-       }
+    $path = $_[0] unless defined $path;
+
     return VMS::Filespec::rmsexpand($path);
 }