summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/doop.c b/doop.c
index 55962a0c5a..526409c16c 100644
--- a/doop.c
+++ b/doop.c
@@ -333,9 +333,11 @@ S_do_trans_simple_utf8(pTHX_ SV *sv)/* SPC - OK */
dend = dstart + nlen;
}
}
- if (grows) {
+ if (grows || hibit) {
sv_setpvn(sv, (char*)dstart, d - dstart);
Safefree(dstart);
+ if (grows && hibit)
+ Safefree(start);
}
else {
*d = '\0';
@@ -343,8 +345,6 @@ S_do_trans_simple_utf8(pTHX_ SV *sv)/* SPC - OK */
}
SvSETMAGIC(sv);
SvUTF8_on(sv);
- if (hibit)
- Safefree(start);
if (!isutf8 && !(PL_hints & HINT_UTF8))
sv_utf8_downgrade(sv, TRUE);
@@ -517,17 +517,17 @@ S_do_trans_complex_utf8(pTHX_ SV *sv) /* SPC - NOT OK */
s += UTF8SKIP(s);
}
}
- if (grows) {
+ if (grows || hibit) {
sv_setpvn(sv, (char*)dstart, d - dstart);
Safefree(dstart);
+ if (grows && hibit)
+ Safefree(start);
}
else {
*d = '\0';
SvCUR_set(sv, d - dstart);
}
SvUTF8_on(sv);
- if (hibit)
- Safefree(start);
if (!isutf8 && !(PL_hints & HINT_UTF8))
sv_utf8_downgrade(sv, TRUE);
SvSETMAGIC(sv);