summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorInaba Hiroto <inaba@st.rim.or.jp>2001-01-10 20:39:39 +0900
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-10 03:17:11 +0000
commit16ec844ddf6ed30b884deee1be32522f7b107b77 (patch)
treec91e1b6ae5eb98e6ea1062eb9259b4e6fbf8aac5 /doop.c
parentc9f931b868379618cf79b68035f0c4b7583e1cac (diff)
downloadperl-16ec844ddf6ed30b884deee1be32522f7b107b77.tar.gz
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
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);