From: Karl Williamson Date: Thu, 12 Nov 2009 00:46:31 +0000 (-0700) Subject: Grow zero length scalars X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e93345f7d058505c90a58addadf79d84cde7c12;p=p5sagit%2Fp5-mst-13.2.git Grow zero length scalars --- diff --git a/sv.c b/sv.c index 4b97e58..2bb6f11 100644 --- a/sv.c +++ b/sv.c @@ -3250,7 +3250,9 @@ Perl_sv_utf8_upgrade_flags_grow(pTHX_ register SV *const sv, const I32 flags, ST return SvCUR(sv); } - if (SvCUR(sv) > 0) { /* Assume Latin-1/EBCDIC */ + if (SvCUR(sv) == 0) { + if (extra) SvGROW(sv, extra); + } else { /* Assume Latin-1/EBCDIC */ /* This function could be much more efficient if we * had a FLAG in SVs to signal if there are any variant * chars in the PV. Given that there isn't such a flag