diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-05 09:01:19 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-05 09:01:19 +0000 |
commit | c342093359181c3927bdc4a1bd84f3a6efd5c4a5 (patch) | |
tree | 3897977a9e799f78e451522c74a9c76509b209e0 /lib/File/Path.pm | |
parent | fe0bfefd1b3391e207af85cacfd6987105cbe653 (diff) | |
download | perl-c342093359181c3927bdc4a1bd84f3a6efd5c4a5.tar.gz |
on dosish platforms, avoid infinite recursion in File::Path::mkpath()
when given non-existent drive names
p4raw-id: //depot/perl@4651
Diffstat (limited to 'lib/File/Path.pm')
-rw-r--r-- | lib/File/Path.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/File/Path.pm b/lib/File/Path.pm index a82fd8004e..634b2cd108 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -126,13 +126,15 @@ sub mkpath { my $parent = File::Basename::dirname($path); # Allow for creation of new logical filesystems under VMS if (not $Is_VMS or $parent !~ m:/[^/]+/000000/?:) { - push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent); + unless (-d $parent or $path eq $parent) { + push(@created,mkpath($parent, $verbose, $mode)); + } } print "mkdir $path\n" if $verbose; unless (mkdir($path,$mode)) { - my $e = $!; - # allow for another process to have created it meanwhile - croak "mkdir $path: $e" unless -d $path; + my $e = $!; + # allow for another process to have created it meanwhile + croak "mkdir $path: $e" unless -d $path; } push(@created, $path); } |