From: Wolfgang Laun Date: Sun, 9 Dec 2001 13:40:58 +0000 (+0100) Subject: Re: [ID 20011206.006] File::Find calls lstat on wrong object before wanted() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9111eb4b24cc5634175dc89e24cf06692ec5175d;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index f43329d..3fbeebc 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 {