summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWolfgang Laun <Wolfgang.Laun@alcatel.at>2001-12-09 14:40:58 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-09 19:21:45 +0000
commit9111eb4b24cc5634175dc89e24cf06692ec5175d (patch)
tree9ede0b40a1b6ad859d71f2da5be5f4878d27a77a /lib
parent95a1a48b3cc1866fad4a1d16bd8f71e45eb1d207 (diff)
downloadperl-9111eb4b24cc5634175dc89e24cf06692ec5175d.tar.gz
Re: [ID 20011206.006] File::Find calls lstat on wrong object before wanted()
Message-ID: <200112091340580550.008ED513@smtp.chello.at> (The lstat()s were there in 5.6.1: what happened to them?) p4raw-id: //depot/perl@13559
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Find.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm
index f43329da14..3fbeebc334 100644
--- a/lib/File/Find.pm
+++ b/lib/File/Find.pm
@@ -718,6 +718,8 @@ sub _find_dir($$$) {
$_= ($no_chdir ? $dir_name : $dir_rel ); # $_
# prune may happen here
$prune= 0;
+ # guarantee lstat for directory
+ lstat( $dir_name );
{ &$wanted_callback }; # protect against wild "next"
next if $prune;
}
@@ -869,6 +871,8 @@ sub _find_dir($$$) {
s|/\.$||;
}
}
+ # guarantee lstat at return to directory
+ lstat( $dir_name );
{ &$wanted_callback }; # protect against wild "next"
}
else {