summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2011-01-28 09:20:17 -0600
committerCraig A. Berry <craigberry@mac.com>2011-01-28 13:17:57 -0600
commit2ccec147976ec11b06dff522ad1f06f47e398eae (patch)
tree567f17861c7ab68b400f66c34ab98d07876cd416
parentf84e912d7ca932a52e18c2af3f2b83670aeaf61d (diff)
downloadperl-2ccec147976ec11b06dff522ad1f06f47e398eae.tar.gz
Fix endless loop in Porting/makemeta.
File::Basename::dirname() returns the current device and directory on VMS when there is no directory information in the path (i.e., you ran out of directories), and the current device and directory are never ".". Now that we run makemeta in the test suite, the expectation that you always get "." was causing the test suite to hang in a CPU-bound loop.
-rw-r--r--Porting/makemeta5
1 files changed, 4 insertions, 1 deletions
diff --git a/Porting/makemeta b/Porting/makemeta
index e0e1ef72ad..c81aec59d4 100644
--- a/Porting/makemeta
+++ b/Porting/makemeta
@@ -34,14 +34,17 @@ my %dirs;
@files = map { " - $_" }
grep {
my $d = $_;
+ my $previous_d = '';
while(($d = dirname($d)) ne "."){
+ last if $d eq $previous_d; # safety valve
last if exists $dirs{$d};
+ $previous_d = $d;
}
# if $d is "." it means we tried every parent dir of the file and none
# of them were in the private list
- $d eq ".";
+ $d eq "." || $d eq $previous_d;
}
sort { lc $a cmp lc $b } @files;