[inseparable changes from patch from perl5.003_24 to perl5.003_25]
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index 3b09463..010a391 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -666,6 +666,7 @@ I32 sv_type;
     case '\017':
     case '\t':
     case '\020':
+    case '\023':
     case '\024':
     case '\027':
        if (len > 1)
@@ -701,10 +702,11 @@ I32 sv_type;
        break;
     case ']':
        if (len == 1) {
-           SV *sv;
-           sv = GvSV(gv);
+           SV *sv = GvSV(gv);
            sv_upgrade(sv, SVt_PVNV);
            sv_setpv(sv, patchlevel);
+           (void)sv_2nv(sv);
+           SvREADONLY_on(sv);
        }
        break;
     }
@@ -997,10 +999,10 @@ HV* stash;
 
     if ( cp = (char *)AMG_names[0] ) {
        /* Try to find via inheritance. */
-       gv = gv_fetchmeth(stash, "()", 2, -1); /* A cooky: "()". */
+       gv = gv_fetchmeth(stash, "()", 2, -1); /* A cookie: "()". */
        if (gv) sv = GvSV(gv);
 
-       if (!gv) goto notable;
+       if (!gv) goto no_table;
        else if (SvTRUE(sv)) amt.fallback=AMGfallYES;
        else if (SvOK(sv)) amt.fallback=AMGfallNEVER;
     }
@@ -1009,7 +1011,7 @@ HV* stash;
         cv = 0;
         cp = (char *)AMG_names[i];
       
-       *buf = '(';                     /* A cooky: "(". */
+       *buf = '(';                     /* A cookie: "(". */
        strcpy(buf + 1, cp);
        DEBUG_o( deb("Checking overloading of `%s' in package `%.256s'\n",
                     cp, HvNAME(stash)) );
@@ -1057,7 +1059,7 @@ HV* stash;
     }
   }
   /* Here we have no table: */
- notable:
+ no_table:
   AMT_AMAGIC_off(&amt);
   sv_magic((SV*)stash, 0, 'c', (char*)&amt, sizeof(AMTS));
   return FALSE;
@@ -1222,8 +1224,9 @@ int flags;
       } else if (cvp && (cv=cvp[nomethod_amg])) {
        notfound = 1; lr = 1;
       } else {
-        if (off==-1) off=method;
-       sprintf(buf, "Operation `%s': no method found,%sargument %s%.256s%s%.256s",
+       if (off==-1) off=method;
+       sprintf(buf,
+               "Operation `%s': no method found,%sargument %s%.256s%s%.256s",
                      AMG_names[method + assignshift],
                      (flags & AMGf_unary ? " " : "\n\tleft "),
                      SvAMAGIC(left)? 
@@ -1250,7 +1253,8 @@ int flags;
     }
   }
   if (!notfound) {
-    DEBUG_o( deb("Overloaded operator `%s'%s%s%s:\n\tmethod%s found%s in package %.256s%s\n",
+    DEBUG_o( deb(
+  "Overloaded operator `%s'%s%s%s:\n\tmethod%s found%s in package %.256s%s\n",
                 AMG_names[off],
                 method+assignshift==off? "" :
                             " (initially `",