}
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) {
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 );
}
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) &&