Change 13874 by jhi@alpha on 2001/12/24 16:41:03

        File::Find patch patches from Thomas Wegner.

Affected files ...

.... //depot/perl/lib/File/Find.pm#59 edit

Differences ...

==== //depot/perl/lib/File/Find.pm#59 (text) ====
Index: perl/lib/File/Find.pm
--- perl/lib/File/Find.pm.~1~   Mon Dec 24 09:45:06 2001
+++ perl/lib/File/Find.pm       Mon Dec 24 09:45:06 2001
@@ -44,7 +44,7 @@
 
 Reports the name of a directory only AFTER all its entries
 have been reported.  Entry point finddepth() is a shortcut for
-specifying C<{ bydepth => 1 }> in the first argument of find().
+specifying C<{ bydepth =E<gt> 1 }> in the first argument of find().
 
 =item C<preprocess>
 
@@ -565,8 +565,6 @@
                $cwd = "$cwd:" unless ($cwd =~ /:$/); # for safety
 
                if ($top_item eq $File::Find::current_dir) {
-                  # avoid empty name after return to '/'
-                  $name = '/' unless length( $name );
                    $abs_dir = $cwd;
                }
                else {
@@ -733,8 +731,6 @@
            $_= ($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;
        }
@@ -886,8 +882,6 @@
                        substr($_, length($_) == 2 ? -1 : -2) = '';
                    }
                }
-                # guarantee lstat at return to directory
-               lstat( $dir_name );
                { &$wanted_callback }; # protect against wild "next"
             }
             else {
@@ -1071,12 +1065,12 @@
                }
                else {
                    if ( substr($name,-2) eq '/.' ) {
-                       $name =~ s|/\.$||; # $File::Find::name
+                       substr($name, length($name) == 2 ? -1 : -2) = ''; # 
+$File::Find::name
                    }
                    $dir = $p_dir; # $File::Find::dir
                    $_ = ($no_chdir ? $dir_name : $dir_rel); # $_
                    if ( substr($_,-2) eq '/.' ) {
-                       s|/\.$||;
+                       substr($_, length($_) == 2 ? -1 : -2) = '';
                    }
                }
 
End of Patch.

Reply via email to