X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_pack.c;h=b66d68283a51ae18905b1d89098297a1f1a5bce9;hb=5284b67eb2f74db7dcaf6c897d9c70d6f197e486;hp=ceb01c5a57ee822ff2292a6649aacdf91383f5a2;hpb=3bf38418777094bb685265138234ab6e04aa1d90;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_pack.c b/pp_pack.c index ceb01c5..b66d682 100644 --- a/pp_pack.c +++ b/pp_pack.c @@ -1,6 +1,6 @@ /* pp_pack.c * - * Copyright (c) 1991-2001, Larry Wall + * Copyright (c) 1991-2002, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -449,7 +449,7 @@ PP(pp_unpack) if (checksum) { while (len-- > 0 && s < strend) { STRLEN alen; - auint = utf8n_to_uvchr((U8*)s, strend - s, &alen, 0); + auint = NATIVE_TO_UNI(utf8n_to_uvchr((U8*)s, strend - s, &alen, 0)); along = alen; s += along; if (checksum > bits_in_uv) @@ -463,7 +463,7 @@ PP(pp_unpack) EXTEND_MORTAL(len); while (len-- > 0 && s < strend) { STRLEN alen; - auint = utf8n_to_uvchr((U8*)s, strend - s, &alen, 0); + auint = NATIVE_TO_UNI(utf8n_to_uvchr((U8*)s, strend - s, &alen, 0)); along = alen; s += along; sv = NEWSV(37, 0); @@ -1558,7 +1558,7 @@ PP(pp_pack) case 'U': while (len-- > 0) { fromstr = NEXTFROM; - auint = SvUV(fromstr); + auint = UNI_TO_NATIVE(SvUV(fromstr)); SvGROW(cat, SvCUR(cat) + UTF8_MAXLEN + 1); SvCUR_set(cat, (char*)uvchr_to_utf8((U8*)SvEND(cat),auint) - SvPVX(cat)); @@ -1843,7 +1843,7 @@ PP(pp_pack) fromstr = NEXTFROM; aptr = SvPV(fromstr, fromlen); SvGROW(cat, fromlen * 4 / 3); - if (len <= 1) + if (len <= 2) len = 45; else len = len / 3 * 3;