From: Charles Bailey Date: Thu, 2 Mar 2000 03:57:40 +0000 (+0000) Subject: Use temp to construct dirspec in File::Find (Charles Lane) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1fff69f13487ea7558f26e1865fa81bbc4fcd820;p=p5sagit%2Fp5-mst-13.2.git Use temp to construct dirspec in File::Find (Charles Lane) p4raw-id: //depot/vmsperl@5422 --- diff --git a/lib/File/Find.pm b/lib/File/Find.pm index 074cff3..165ab9c 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -515,8 +515,9 @@ sub _find_dir($$$) { if ( defined ($SE = pop @Stack) ) { ($Level, $p_dir, $dir_rel, $nlink) = @$SE; if ($CdLvl > $Level && !$no_chdir) { - die "Can't cd to $dir_name" . '../' x ($CdLvl-$Level) - unless chdir '../' x ($CdLvl-$Level); + my $tmp = join('/',('..') x ($CdLvl-$Level)); + die "Can't cd to $dir_name" . $tmp + unless chdir ($tmp); $CdLvl = $Level; } $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel");