summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-01 16:35:28 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-01 16:35:28 +0000
commit579077630923d231795d873e06ff21d06d7753d9 (patch)
treee3b44ddce5af42a037b455baad39fc4edf9b730f /lib
parentfad188d8e9197ba1175b85ff9cdb2c6a9e753afb (diff)
downloadperl-579077630923d231795d873e06ff21d06d7753d9.tar.gz
fix minor compatibility issues with finddepth() (from Helmut Jarausch)
p4raw-id: //depot/perl@5401
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Find.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm
index a5e750e395..0fa0032206 100644
--- a/lib/File/Find.pm
+++ b/lib/File/Find.pm
@@ -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;