From: David Dyck Date: Tue, 29 May 2001 12:19:38 +0000 (-0700) Subject: [ID 20010529.003] find2perl and File::Find doesn't emulate find when path is a symlin... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0c1c71f241ab034fc59d9d6483c8f8f70e144df6;p=p5sagit%2Fp5-mst-13.2.git [ID 20010529.003] find2perl and File::Find doesn't emulate find when path is a symlink (with proposed patch) Message-Id: p4raw-id: //depot/perl@10308 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index ef3d241..cec6afb 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -330,9 +330,8 @@ sub _find_opt { $top_item =~ s|/\z|| unless $top_item eq '/'; $Is_Dir= 0; - ($topdev,$topino,$topmode,$topnlink) = stat $top_item; - if ($follow) { + ($topdev,$topino,$topmode,$topnlink) = stat $top_item; if (substr($top_item,0,1) eq '/') { $abs_dir = $top_item; } @@ -353,6 +352,7 @@ sub _find_opt { } } else { # no follow + ($topdev,$topino,$topmode,$topnlink) = lstat $top_item; $topdir = $top_item; unless (defined $topnlink) { warn "Can't stat $top_item: $!\n";