summaryrefslogtreecommitdiff
path: root/ext/File
diff options
context:
space:
mode:
Diffstat (limited to 'ext/File')
-rw-r--r--ext/File/Glob/Glob.pm1
-rw-r--r--ext/File/Glob/bsd_glob.c7
-rwxr-xr-xext/File/Glob/t/basic.t6
3 files changed, 13 insertions, 1 deletions
diff --git a/ext/File/Glob/Glob.pm b/ext/File/Glob/Glob.pm
index a704b567bb..d670b6ae7b 100644
--- a/ext/File/Glob/Glob.pm
+++ b/ext/File/Glob/Glob.pm
@@ -125,6 +125,7 @@ sub bsd_glob {
# File::Glob::glob() is deprecated because its prototype is different from
# CORE::glob() (use bsd_glob() instead)
sub glob {
+ splice @_, 1; # don't pass PL_glob_index as flags!
goto &bsd_glob;
}
diff --git a/ext/File/Glob/bsd_glob.c b/ext/File/Glob/bsd_glob.c
index 83d71f0b0f..c01e75a6e1 100644
--- a/ext/File/Glob/bsd_glob.c
+++ b/ext/File/Glob/bsd_glob.c
@@ -261,12 +261,19 @@ bsd_glob(const char *pattern, int flags,
#ifndef MACOS_TRADITIONAL
patnext = (U8 *) pattern;
#endif
+ /* TODO: GLOB_APPEND / GLOB_DOOFFS aren't supported yet */
+#if 0
if (!(flags & GLOB_APPEND)) {
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
if (!(flags & GLOB_DOOFFS))
pglob->gl_offs = 0;
}
+#else
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ pglob->gl_offs = 0;
+#endif
pglob->gl_flags = flags & ~GLOB_MAGCHAR;
pglob->gl_errfunc = errfunc;
pglob->gl_matchc = 0;
diff --git a/ext/File/Glob/t/basic.t b/ext/File/Glob/t/basic.t
index 91f79138d6..00bd740612 100755
--- a/ext/File/Glob/t/basic.t
+++ b/ext/File/Glob/t/basic.t
@@ -13,7 +13,7 @@ BEGIN {
print "1..0\n";
exit 0;
}
- print "1..11\n";
+ print "1..12\n";
}
END {
print "not ok 1\n" unless $loaded;
@@ -182,3 +182,7 @@ print $ok ? "ok 11\n" : "not ok 11\n";
unlink @f_names;
chdir "..";
rmdir "pteerslo";
+
+# this can panic if PL_glob_index gets passed as flags to bsd_glob
+<*>; <*>;
+print "ok 12\n";