Improve description of the -s switch.
[p5sagit/p5-mst-13.2.git] / mg.c
diff --git a/mg.c b/mg.c
index 703a876..d1bed8e 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -430,15 +430,12 @@ Perl_mg_localize(pTHX_ SV *sv, SV *nsv)
            continue;
        }
                
-       if ((mg->mg_flags & MGf_COPY) && vtbl->svt_copy) {
-           /* XXX calling the copy method is probably not correct. DAPM */
-           (void)CALL_FPTR(vtbl->svt_copy)(aTHX_ sv, mg, nsv,
-                                   mg->mg_ptr, mg->mg_len);
-       }
-       else {
+       if ((mg->mg_flags & MGf_LOCAL) && vtbl->svt_local)
+           (void)CALL_FPTR(vtbl->svt_local)(aTHX_ nsv, mg);
+       else
            sv_magicext(nsv, mg->mg_obj, mg->mg_type, vtbl,
                            mg->mg_ptr, mg->mg_len);
-       }
+
        /* container types should remain read-only across localization */
        SvFLAGS(nsv) |= SvREADONLY(sv);
     }
@@ -1447,7 +1444,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
         * tell whether HINT_STRICT_REFS is in force or not.
         */
        if (!strchr(s,':') && !strchr(s,'\''))
-           sv_insert(sv, 0, 0, "main::", 6);
+           Perl_sv_insert(aTHX_ sv, 0, 0, STR_WITH_LEN("main::"));
        if (i)
            (void)rsignal(i, PL_csighandlerp);
        else