with the test patch below it fails when the arg is '', so the other 
patch is fixing modperl_perl_module_loaded() to check the length of its 
argument.

Or is this a bug in gv_stashpv? (tested only with 5.8.0-RC2)

Index: src/modules/perl/modperl_util.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
retrieving revision 1.47
diff -u -r1.47 modperl_util.c
--- src/modules/perl/modperl_util.c     21 Jun 2002 00:44:24 -0000      1.47
+++ src/modules/perl/modperl_util.c     26 Jun 2002 16:20:09 -0000
@@ -602,7 +602,7 @@

  MP_INLINE int modperl_perl_module_loaded(pTHX_ const char *name)
  {
-    return gv_stashpv(name, FALSE) ? 1 : 0;
+    return (strlen(name) && gv_stashpv(name, FALSE)) ? 1 : 0;
  }

  /* same as Symbol::gensym() */
Index: t/response/TestAPI/module.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
retrieving revision 1.7
diff -u -r1.7 module.pm
--- t/response/TestAPI/module.pm        19 May 2002 19:10:45 -0000      1.7
+++ t/response/TestAPI/module.pm        26 Jun 2002 16:20:09 -0000
@@ -18,7 +18,7 @@

      my $cfg = Apache::Test::config();

-    plan $r, tests => 13;
+    plan $r, tests => 14;

      my $top_module = Apache::Module->top_module;

@@ -91,6 +91,9 @@
      #bogus
      ok t_cmp(0, Apache::Module::loaded('Apache__Module_foo.foo'),
               "Apache::Module::loaded('Apache__Module_foo.foo')");
+
+    ok t_cmp(0, Apache::Module::loaded(''),
+             "Apache::Module::loaded('')");

      Apache::OK;
  }


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to