File::Path::rmtree() doesn't delete stale symlinks correctly
Gurusamy Sarathy [Mon, 6 Mar 2000 15:17:08 +0000 (15:17 +0000)]
p4raw-id: //depot/perl@5581

lib/File/Path.pm

index 79fdfb6..fb5377d 100644 (file)
@@ -205,7 +205,9 @@ sub rmtree {
        }
        else { 
            if ($safe &&
-               ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) {
+               ($Is_VMS ? !&VMS::Filespec::candelete($root)
+                        : !(-l $root || -w $root)))
+           {
                print "skipped $root\n" if $verbose;
                next;
            }