From: Inaba Hiroto Date: Wed, 10 Jan 2001 11:39:39 +0000 (+0900) Subject: Re: more UTF8 test suites and an UTF8 patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16ec844ddf6ed30b884deee1be32522f7b107b77;p=p5sagit%2Fp5-mst-13.2.git Re: more UTF8 test suites and an UTF8 patch Message-Id: <10101100239.AA10002@tux0017.sdd.tokyo-sc.toshiba.co.jp> Some more UTF-8 tr cases fixed. p4raw-id: //depot/perl@8385 --- diff --git a/doop.c b/doop.c index 55962a0..526409c 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);