diff options
author | Chip Salzenberg <chip@pobox.com> | 1998-03-04 01:04:37 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-03-04 01:04:37 +0000 |
commit | 94d4f21ce5099f301ed168bfe5ebf5e185d03459 (patch) | |
tree | 6f20e516395a2b59f1499351cf2f233cddada527 /lib/File | |
parent | 3e8584ad361ac6d437a790e5f45230558fe68808 (diff) | |
download | perl-94d4f21ce5099f301ed168bfe5ebf5e185d03459.tar.gz |
[win32] sync maintpatch
#76: "Fix infinite loop on unlink() failure in File::Path::rmtree()
Files: lib/File/Path.pm
p4raw-id: //depot/win32/perl@723
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Path.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 492f150b5a..6b5d5683f1 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -92,7 +92,7 @@ Charles Bailey <F<bailey@genetics.upenn.edu>> =head1 REVISION -Current $VERSION is 1.04. +Current $VERSION is 1.0401. =cut @@ -103,7 +103,7 @@ use Exporter (); use strict; use vars qw( $VERSION @ISA @EXPORT ); -$VERSION = "1.04"; +$VERSION = "1.0401"; @ISA = qw( Exporter ); @EXPORT = qw( mkpath rmtree ); @@ -202,18 +202,18 @@ sub rmtree { if $force_writeable; print "unlink $root\n" if $verbose; # delete all versions under VMS - while (-e $root || -l $root) { - if (unlink $root) { - ++$count; - } - else { + for (;;) { + unless (unlink $root) { carp "Can't unlink file $root: $!"; if ($force_writeable) { chmod $rp, $root or carp("and can't restore permissions to " . sprintf("0%o",$rp) . "\n"); } + last; } + ++$count; + last unless $Is_VMS && lstat $root; } } } |