From: Nick Ing-Simmons Date: Mon, 22 Apr 2002 08:02:58 +0000 (+0000) Subject: Integrate mainline into perlio X-Git-Tag: accepted/trunk/20130322.191538~23899^2~232 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f682c053747030c533c13711625f2209c5ae077;p=platform%2Fupstream%2Fperl.git Integrate mainline into perlio p4raw-id: //depot/perlio@16064 --- 5f682c053747030c533c13711625f2209c5ae077 diff --cc ext/PerlIO/encoding/encoding.xs index 09eeb45,23de989..a864c8a --- a/ext/PerlIO/encoding/encoding.xs +++ b/ext/PerlIO/encoding/encoding.xs @@@ -302,15 -237,8 +302,15 @@@ PerlIOEncode_fill(pTHX_ PerlIO * f if (SvLEN(e->dataSV) && SvPVX(e->dataSV)) { Safefree(SvPVX(e->dataSV)); } - if (use > e->base.bufsiz) { + if (use > (SSize_t)e->base.bufsiz) { - use = e->base.bufsiz; + if (e->flags & NEEDS_LINES) { + /* Have to grow buffer */ + e->base.bufsiz = use; + PerlIOEncode_get_base(aTHX_ f); + } + else { + use = e->base.bufsiz; + } } SvPVX(e->dataSV) = (char *) ptr; SvLEN(e->dataSV) = 0; /* Hands off sv.c - it isn't yours */