Use the address of the glob op instead.
This argument is going away, because it is undocumented, unused on
CPAN outside of the core, and may get in the way of allowing glob() to
be overridden properly.
Another reason is that File::DosGlob leaks memory, because a glob op
freed before iteration has finished will leave File::DosGlob still
holding on to the remainder of the list of files. The easiest way to
fix that will involve using an op address instead of a special index,
so there will be no reason to keep it.
ext/FileCache/t/05override.t See if FileCache works
ext/FileCache/t/06export.t See if FileCache exporting works
ext/FileCache/t/07noimport.t See if FileCache works without importing
+ext/File-DosGlob/DosGlob.xs Win32 DOS-globbing module
ext/File-DosGlob/lib/File/DosGlob.pm Win32 DOS-globbing module
ext/File-DosGlob/t/DosGlob.t See if File::DosGlob works
ext/File-Glob/bsd_glob.c File::Glob extension run time code
--- /dev/null
+#define PERL_NO_GET_CONTEXT
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+MODULE = File::DosGlob PACKAGE = File::DosGlob
+
+PROTOTYPES: DISABLE
+
+SV *
+_callsite(...)
+ CODE:
+ RETVAL = newSVpvn(
+ (char *)&cxstack[cxstack_ix].blk_sub.retop, sizeof(OP *)
+ );
+ OUTPUT:
+ RETVAL
use strict;
use warnings;
+require XSLoader;
+XSLoader::load();
+
sub doglob {
my $cond = shift;
my @retval = ();
my %entries;
sub glob {
- my($pat,$cxix) = @_;
+ my($pat,$cxix) = ($_[0], _callsite());
my @pat;
# glob without args defaults to $_
$pat = $_ unless defined $pat;
- # assume global context if not provided one
- $cxix = '_G_' unless defined $cxix;
-
# if we're just beginning, do it all first
if (!$entries{$cxix}) {
# extract patterns
# test glob() in File::DosGlob
#
+# Make sure it can load before other XS extensions
+use File::DosGlob;
+
use FindBin;
use File::Spec::Functions;
BEGIN {