Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perl #114984] Glob.xs: Extend stack when returning
If a pattern passed to File::Glob consists of a space-separated list of patterns, the stack will only be extended by doglob() enough for the list returned by each subpattern. So iterate() needs to extend the stack before copying the list of files from an AV to the stack. This fixes a regression introduced in 5.16.0.
- Loading branch information
Father Chrysostomos
committed
Sep 20, 2012
1 parent
a71a1af
commit a6636b4
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use strict; | ||
use warnings; | ||
use v5.16.0; | ||
use File::Temp 'tempdir'; | ||
use File::Spec::Functions; | ||
use Test::More tests => 1; | ||
|
||
my @md = (1..305); | ||
my @mp = (1000..1205); | ||
|
||
my $path = tempdir uc cleanup => 1; | ||
|
||
foreach (@md) { | ||
open(my $f, ">", catfile $path, "md_$_.dat"); | ||
close $f; | ||
} | ||
|
||
foreach (@mp) { | ||
open(my $f, ">", catfile $path, "mp_$_.dat"); | ||
close $f; | ||
} | ||
my @b = glob(qq{$path/mp_[0123456789]*.dat | ||
$path/md_[0123456789]*.dat}); | ||
is scalar(@b), @md+@mp, | ||
'File::Glob extends the stack when returning a long list'; |