[perl #22944] PERL5LIB is not colon-separated everywhere
[p5sagit/p5-mst-13.2.git] / mg.c
diff --git a/mg.c b/mg.c
index 8182376..dc1666a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1881,6 +1881,7 @@ Perl_magic_killbackrefs(pTHX_ SV *sv, MAGIC *mg)
        }
        i--;
     }
+    SvREFCNT_dec(av); /* remove extra count added by sv_add_backref() */
     return 0;
 }
 
@@ -2372,15 +2373,9 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
             pstat(PSTAT_SETCMD, un, len, 0, 0);
        }
 #endif
-       /* PL_origalen is set in perl_parse() to be the sum
-        * of the contiguous argv[] elements plus the size of
-        * the env in case that is contiguous with the argv[].
-        *
-        * This means that in the worst case the area we are able
-        * to modify is limited to the size of the original argv[0].
-        * --jhi */
+       /* PL_origalen is set in perl_parse(). */
        s = SvPV_force(sv,len);
-       if (len >= (I32)PL_origalen) {
+       if (len >= (STRLEN)PL_origalen) {
            /* Longer than original, will be truncated. */
            Copy(s, PL_origargv[0], PL_origalen, char);
            PL_origargv[0][PL_origalen - 1] = 0;
@@ -2392,7 +2387,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
            memset(PL_origargv[0] + len + 1,
                   /* Is the space counterintuitive?  Yes.
                    * (You were expecting \0?)  
-                   * Does it work?  Seems to.  (In Linux at least.)
+                   * Does it work?  Seems to.  (In Linux 2.4.20 at least.)
                    * --jhi */
                   (int)' ',
                   PL_origalen - len - 1);