Always defining PERLIO_TERM, even if it's empty, makes for a simpler
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index 203b05c..9ad4434 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -81,13 +81,12 @@ Perl_gv_IOadd(pTHX_ register GV *gv)
          * this is a dirhandle.
          */
        const char * const fh =
-           (const char *)
-           (PL_op->op_type ==  OP_READDIR ||
-            PL_op->op_type ==  OP_TELLDIR ||
-            PL_op->op_type ==  OP_SEEKDIR ||
-            PL_op->op_type ==  OP_REWINDDIR ||
-            PL_op->op_type ==  OP_CLOSEDIR ?
-            "dirhandle" : "filehandle");
+                        PL_op->op_type ==  OP_READDIR ||
+                         PL_op->op_type ==  OP_TELLDIR ||
+                         PL_op->op_type ==  OP_SEEKDIR ||
+                         PL_op->op_type ==  OP_REWINDDIR ||
+                         PL_op->op_type ==  OP_CLOSEDIR ?
+                         "dirhandle" : "filehandle";
         Perl_croak(aTHX_ "Bad symbol for %s", fh);
     }
 
@@ -162,8 +161,7 @@ GP *
 Perl_newGP(pTHX_ GV *const gv)
 {
     GP *gp;
-    const char *const file =
-       CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (const char *)"";
+    const char *const file = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : "";
     STRLEN len = strlen(file);
     U32 hash;
 
@@ -1190,10 +1188,14 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
            goto magicalize;
 
        case '+':
+       GvMULTI_on(gv);
        {
            AV* const av = GvAVn(gv);
+           HV* const hv = GvHVn(gv);
             sv_magic((SV*)av, (SV*)av, PERL_MAGIC_regdata, NULL, 0);
            SvREADONLY_on(av);
+           hv_magic(hv, NULL, PERL_MAGIC_regdata_names);
+           SvREADONLY_on(hv);
            /* FALL THROUGH */
        }
        case '\023':    /* $^S */
@@ -1277,7 +1279,7 @@ Perl_gv_fullname4(pTHX_ SV *sv, const GV *gv, const char *prefix, bool keepmain)
        SvOK_off(sv);
        return;
     }
-    sv_setpv(sv, prefix ? prefix : (const char *)"");
+    sv_setpv(sv, prefix ? prefix : "");
 
     name = HvNAME_get(hv);
     if (name) {
@@ -1562,9 +1564,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash)
                                                       FALSE)))
                {
                    /* Can be an import stub (created by "can"). */
-                   const char * const name =
-                       (const char *)
-                       ((gvsv && SvPOK(gvsv)) ?  SvPVX_const(gvsv) : "???");
+                   const char * const name = (gvsv && SvPOK(gvsv)) ?  SvPVX_const(gvsv) : "???";
                    Perl_croak(aTHX_ "%s method \"%.256s\" overloading \"%s\" "\
                                "in package \"%.256s\"",
                               (GvCVGEN(gv) ? "Stub found while resolving"
@@ -1833,6 +1833,9 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
        notfound = 1; lr = -1;
       } else if (cvp && (cv=cvp[nomethod_amg])) {
        notfound = 1; lr = 1;
+      } else if ((amtp && amtp->fallback >= AMGfallYES) && !DEBUG_o_TEST) {
+       /* Skip generating the "no method found" message.  */
+       return NULL;
       } else {
        SV *msg;
        if (off==-1) off=method;