dougm       01/04/11 17:45:42

  Modified:    src/modules/perl modperl_const.c
  Log:
  only bleedperl newCONSTSUB returns a CV, older Perls are void
  
  Revision  Changes    Path
  1.4       +4 -6      modperl-2.0/src/modules/perl/modperl_const.c
  
  Index: modperl_const.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_const.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- modperl_const.c   2001/04/11 23:11:01     1.3
  +++ modperl_const.c   2001/04/12 00:45:42     1.4
  @@ -9,11 +9,11 @@
                           const char *name)
   {
       int name_len = strlen(name);
  -    GV **gvp = (GV **)hv_fetch(stash, name, name_len, FALSE);
  +    GV **gvp = (GV **)hv_fetch(stash, name, name_len, TRUE);
       int val;
   
       /* dont redefine */
  -    if (!(gvp && GvCV(*gvp))) {
  +    if (!isGV(*gvp) || !GvCV(*gvp)) {
           CV *cv;
   
           val = (*lookup)(name);
  @@ -23,13 +23,11 @@
                   HvNAME(stash), name, val);
   #endif
   
  -        cv = newCONSTSUB(stash, (char *)name, newSViv(val));
  -
  -        gvp = &CvGV(cv);
  +        newCONSTSUB(stash, (char *)name, newSViv(val));
       }
       
       /* export into callers namespace */
  -    if (gvp && caller_stash) {
  +    if (caller_stash) {
           GV *alias = *(GV **)hv_fetch(caller_stash,
                                        (char *)name, name_len, TRUE);
   
  
  
  

Reply via email to