This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #40369] File::Find mishandles non-dangling symlinks
[perl5.git] / 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 {