Half way through moving per-thread magicals into per-thread fields
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 99abde9..3f339e9 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -278,11 +278,10 @@ PP(pp_warn)
        tmps = SvPV(TOPs, na);
     }
     if (!tmps || !*tmps) {
-       SV *error = GvSV(errgv);
-       (void)SvUPGRADE(error, SVt_PV);
-       if (SvPOK(error) && SvCUR(error))
-           sv_catpv(error, "\t...caught");
-       tmps = SvPV(error, na);
+       (void)SvUPGRADE(errsv, SVt_PV);
+       if (SvPOK(errsv) && SvCUR(errsv))
+           sv_catpv(errsv, "\t...caught");
+       tmps = SvPV(errsv, na);
     }
     if (!tmps || !*tmps)
        tmps = "Warning: something's wrong";
@@ -304,11 +303,10 @@ PP(pp_die)
        tmps = SvPV(TOPs, na);
     }
     if (!tmps || !*tmps) {
-       SV *error = GvSV(errgv);
-       (void)SvUPGRADE(error, SVt_PV);
-       if (SvPOK(error) && SvCUR(error))
-           sv_catpv(error, "\t...propagated");
-       tmps = SvPV(error, na);
+       (void)SvUPGRADE(errsv, SVt_PV);
+       if (SvPOK(errsv) && SvCUR(errsv))
+           sv_catpv(errsv, "\t...propagated");
+       tmps = SvPV(errsv, na);
     }
     if (!tmps || !*tmps)
        tmps = "Died";