#define HALF_UTF8_UPGRADE(start,end) \
STMT_START { \
+ if ((start)<(end)) { \
U8* NeWsTr; \
STRLEN LeN = (end) - (start); \
NeWsTr = bytes_to_utf8(start, &LeN); \
Safefree(start); \
(start) = NeWsTr; \
(end) = (start) + LeN; \
+ } \
} STMT_END
STATIC I32
}
*d = '\0';
sv_setpvn(sv, (const char*)dstart, d - dstart);
+ Safefree(dstart);
SvUTF8_on(sv);
- SvLEN_set(sv, 2*len+1);
SvSETMAGIC(sv);
return matches;
}
(void)SvUPGRADE(sv, SVt_PV);
if (SvLEN(sv) < len + items) { /* current length is way too short */
while (items-- > 0) {
- if (*mark && !SvGMAGICAL(*mark) && SvOK(*mark)) {
+ if (*mark && !SvGAMAGIC(*mark) && SvOK(*mark)) {
SvPV(*mark, tmplen);
len += tmplen;
}