summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCharles Bailey <bailey@newman.upenn.edu>2000-03-02 03:57:40 +0000
committerbailey <bailey@newman.upenn.edu>2000-03-02 03:57:40 +0000
commit1fff69f13487ea7558f26e1865fa81bbc4fcd820 (patch)
treec919a52536eb142c698478ef2d9e4c43eaebe100 /lib
parent7de3340ab87c076f78c8de58446d891d462a7333 (diff)
downloadperl-1fff69f13487ea7558f26e1865fa81bbc4fcd820.tar.gz
Use temp to construct dirspec in File::Find (Charles Lane)
p4raw-id: //depot/vmsperl@5422
Diffstat (limited to 'lib')
-rw-r--r--lib/File/Find.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm
index 074cff3c71..165ab9c5ce 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");