[perl #40369] File::Find mishandles non-dangling symlinks
ammon@rhythm.com [Tue, 19 Sep 2006 20:56:32 +0000 (13:56 -0700)]
From: ammon@rhythm.com (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.5.HEAD-31258-1158724592-1714.40369-75-0@perl.org>

p4raw-id: //depot/perl@28876

lib/File/Find.pm

index 213b4c0..864c207 100644 (file)
@@ -1119,7 +1119,7 @@ sub _find_dir_symlnk($$$) {
 
            # ignore if invalid symlink
            unless (defined $new_loc) {
-               if ($dangling_symlinks) {
+               if (!defined -l _ && $dangling_symlinks) {
                    if (ref $dangling_symlinks eq 'CODE') {
                        $dangling_symlinks->($FN, $dir_pref);
                    } else {