From: Jarkko Hietaniemi Date: Sun, 13 Jan 2002 18:12:23 +0000 (+0000) Subject: Grow the buffer in case Unicode caused size changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5df7693a57e747d288ae1a7594a516d57bfaf895;p=p5sagit%2Fp5-mst-13.2.git Grow the buffer in case Unicode caused size changes (and it very probably did). p4raw-id: //depot/perl@14243 --- diff --git a/sv.c b/sv.c index 3de686f..0e0c5fc 100644 --- a/sv.c +++ b/sv.c @@ -8362,10 +8362,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV if (elen) { if (is_utf8 != has_utf8) { if (is_utf8) { - if (SvCUR(sv)) { + if (SvCUR(sv)) sv_utf8_upgrade(sv); - p = SvEND(sv); - } } else { SV *nsv = sv_2mortal(newSVpvn(eptr, elen)); @@ -8373,6 +8371,8 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV eptr = SvPVX(nsv); elen = SvCUR(nsv); } + SvGROW(sv, SvCUR(sv) + elen + 1); + p = SvEND(sv); } Copy(eptr, p, elen, char); p += elen;