File::Glob: Eliminate the doglob alias to bsd_glob
authorFather Chrysostomos <sprout@cpan.org>
Thu, 27 Oct 2011 06:48:27 +0000 (23:48 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 27 Oct 2011 07:27:06 +0000 (00:27 -0700)
I’m referring here to CVs, not C functions.

Actually, bsd_glob is the alias to doglob.  doglob is no longer
called, as of commit 1bb8785ab1.  So this commit is actually renaming
doglob to bsd_glob and removing the alias.

dist/XSLoader/t/XSLoader.t
ext/File-Glob/Glob.xs

index bf02e48..aab0af1 100644 (file)
@@ -25,7 +25,9 @@ BEGIN {
 my %modules = (
     # ModuleName  => q|code to check that it was loaded|,
     'Cwd'        => q| ::can_ok( 'Cwd' => 'fastcwd'         ) |,  # 5.7 ?
-    'File::Glob' => q| ::can_ok( 'File::Glob' => 'doglob'   ) |,  # 5.6
+    'File::Glob' => q| ::can_ok( 'File::Glob' =>                  # 5.6
+                                   $] > 5.014
+                                     ? 'bsd_glob' : 'doglob') |,
     $db_file     => q| ::can_ok( $db_file => 'TIEHASH'      ) |,  # 5.0
     'Socket'     => q| ::can_ok( 'Socket' => 'inet_aton'    ) |,  # 5.0
     'Time::HiRes'=> q| ::can_ok( 'Time::HiRes' => 'usleep'  ) |,  # 5.7.3
index a5f531d..830bb8c 100644 (file)
@@ -272,9 +272,8 @@ GLOB_ERROR()
        RETVAL
 
 void
-doglob(pattern,...)
+bsd_glob(pattern,...)
     char *pattern
-PROTOTYPE: $;$
 PREINIT:
     glob_t pglob;
     int i;
@@ -284,14 +283,13 @@ PREINIT:
 PPCODE:
     {
        dMY_CXT;
-       dXSI32;
 
        /* allow for optional flags argument */
        if (items > 1) {
            flags = (int) SvIV(ST(1));
            /* remove unsupported flags */
            flags &= ~(GLOB_APPEND | GLOB_DOOFFS | GLOB_ALTDIRFUNC | GLOB_MAGCHAR);
-       } else if (ix) {
+       } else {
            flags = (int) SvIV(get_sv("File::Glob::DEFAULT_FLAGS", GV_ADD));
        }
        
@@ -319,8 +317,6 @@ PPCODE:
 
 BOOT:
 {
-    CV *cv = newXS("File::Glob::bsd_glob", XS_File__Glob_doglob, __FILE__);
-    XSANY.any_i32 = 1;
 #ifndef PERL_EXTERNAL_GLOB
     /* Don’t do this at home! The globhook interface is highly volatile. */
     PL_globhook = csh_glob;