{
int i;
Char *lm, *ls;
- const Char *pe, *pm, *pl;
+ const Char *pe, *pm, *pm1, *pl;
Char patbuf[MAXPATHLEN];
/* copy part up to the brace */
switch (*pm) {
case BG_LBRACKET:
/* Ignore everything between [] */
- for (pl = pm++; *pm != BG_RBRACKET && *pm != BG_EOS; pm++)
+ for (pm1 = pm++; *pm != BG_RBRACKET && *pm != BG_EOS; pm++)
;
if (*pm == BG_EOS) {
/*
* We could not find a matching BG_RBRACKET.
* Ignore and just look for BG_RBRACE
*/
- pm = pl;
+ pm = pm1;
}
break;
print "1..0\n";
exit 0;
}
- print "1..12\n";
+ print "1..13\n";
}
END {
print "not ok 1\n" unless $loaded;
# this can panic if PL_glob_index gets passed as flags to bsd_glob
<*>; <*>;
print "ok 12\n";
+
+{
+ use File::Temp qw(tempdir);
+ use File::Spec qw();
+
+ my($dir) = tempdir(CLEANUP => 1)
+ or die "Could not create temporary directory";
+ for my $file (qw(a_dej a_ghj a_qej)) {
+ open my $fh, ">", File::Spec->catfile($dir, $file)
+ or die "Could not create file $dir/$file: $!";
+ close $fh;
+ }
+ my $cwd = Cwd::cwd();
+ chdir $dir
+ or die "Could not chdir to $dir: $!";
+ my(@glob_files) = glob("a*{d[e]}j");
+ if (!(@glob_files == 1 && "@glob_files" eq "a_dej")) {
+ print "not ";
+ }
+ print "ok 13\n";
+ chdir $cwd
+ or die "Could not chdir back to $cwd: $!";
+}