From: Spider Boardman Date: Thu, 14 Sep 2000 19:06:36 +0000 (-0400) Subject: Re: perl@7078 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d2f449dd43c68ee43aecff7e17640d02830ae584;p=p5sagit%2Fp5-mst-13.2.git Re: perl@7078 Message-Id: <200009142306.TAA20082@leggy.zk3.dec.com> p4raw-id: //depot/perl@7090 --- diff --git a/sv.c b/sv.c index a89c49a..a694fed 100644 --- a/sv.c +++ b/sv.c @@ -2412,9 +2412,9 @@ Perl_sv_utf8_upgrade(pTHX_ register SV *sv) if (hibit) { STRLEN len = SvCUR(sv) + 1; /* Plus the \0 */ SvPVX(sv) = (char*)bytes_to_utf8((U8*)s, &len); - SvCUR(sv) = len - 1; + SvCUR(sv) = len; /* No longer know the real size. */ SvUTF8_on(sv); - Safefree(s); /* No longer using what was there before */ + Safefree(s); /* No longer using what was there before. */ } } diff --git a/toke.c b/toke.c index e75d878..9821201 100644 --- a/toke.c +++ b/toke.c @@ -1490,6 +1490,8 @@ S_scan_const(pTHX_ char *start) SvCUR_set(sv, d - ostart); SvPOK_on(sv); sv_utf8_upgrade(sv); + /* this just broke our allocation above... */ + SvGROW(sv, send - start); d = SvPVX(sv) + SvCUR(sv); has_utf = TRUE; }