Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / lib / File / Find.pm
index a5e750e..0fa0032 100644 (file)
@@ -520,8 +520,14 @@ sub _find_dir($$$) {
            $dir_pref = "$dir_name/";
             if ( $nlink < 0 ) {  # must be finddepth, report dirname now
                 $name = $dir_name;
+                if ( substr($name,-2) eq '/.' ) {
+                  $name =~ s|/\.$||;
+                }
                 $dir = $p_dir;
                 $_ = ($no_chdir ? $dir_name : $dir_rel );
+                if ( substr($_,-2) eq '/.' ) {
+                  s|/\.$||;
+                }
                 &$wanted_callback;
             } else {
                 push @Stack,[$CdLvl,$p_dir,$dir_rel,-1]  if  $bydepth;
@@ -658,8 +664,15 @@ sub _find_dir_symlnk($$$) {
                }
                $fullname = $dir_loc;
                $name = $dir_name;
+                if ( substr($name,-2) eq '/.' ) {
+                  $name =~ s|/\.$||;
+                }
                 $dir = $p_dir;
                $_ = ($no_chdir ? $dir_name : $dir_rel);
+                if ( substr($_,-2) eq '/.' ) {
+                  s|/\.$||;
+                }
+
                &$wanted_callback;
             } else {
                 push @Stack,[$dir_loc, $pdir_loc, $p_dir, $dir_rel,-1]  if  $bydepth;