Add Win32 makefile option to link all extensions statically
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index 02e530f..dbfc95c 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4066,7 +4066,7 @@ PP(pp_hslice)
         }
 
         he = hv_fetch_ent(hv, keysv, lval, 0);
-        svp = he ? &HeVAL(he) : 0;
+        svp = he ? &HeVAL(he) : NULL;
 
         if (lval) {
             if (!svp || *svp == &PL_sv_undef) {
@@ -4420,12 +4420,17 @@ PP(pp_push)
        PUSHi( AvFILL(ary) + 1 );
     }
     else {
+       PL_delaymagic = DM_DELAY;
        for (++MARK; MARK <= SP; MARK++) {
            SV * const sv = newSV(0);
            if (*MARK)
                sv_setsv(sv, *MARK);
            av_store(ary, AvFILLp(ary)+1, sv);
        }
+       if (PL_delaymagic & DM_ARRAY)
+           mg_set((SV*)ary);
+
+       PL_delaymagic = 0;
        SP = ORIGMARK;
        PUSHi( AvFILLp(ary) + 1 );
     }
@@ -4726,26 +4731,36 @@ PP(pp_split)
         else
             EXTEND(SP, slen);
 
-        while (--limit) {
-            m = s;
-            
-            if (do_utf8)
+        if (do_utf8) {
+            while (--limit) {
+                /* keep track of how many bytes we skip over */
+                m = s;
                 s += UTF8SKIP(s);
-            else
-                ++s;
+                dstr = newSVpvn(m, s-m);
 
-            dstr = newSVpvn(m, s-m);
+                if (make_mortal)
+                    sv_2mortal(dstr);
 
-            if (make_mortal)
-                sv_2mortal(dstr);
-            if (do_utf8)
                 (void)SvUTF8_on(dstr);
+                PUSHs(dstr);
+
+                if (s >= strend)
+                    break;
+            }
+        } else {
+            while (--limit) {
+                dstr = newSVpvn(s, 1);
 
-            PUSHs(dstr);
+                s++;
 
-            /* are we there yet? */
-            if (s >= strend)
-                break;
+                if (make_mortal)
+                    sv_2mortal(dstr);
+
+                PUSHs(dstr);
+
+                if (s >= strend)
+                    break;
+            }
         }
     }
     else if (do_utf8 == ((rx->extflags & RXf_UTF8) != 0) &&