From 05dee287818768241f07710b93adfb5d0b438ff3 Mon Sep 17 00:00:00 2001 From: Josh ben Jore Date: Wed, 14 Jul 2010 22:02:28 -0700 Subject: [PATCH] [perl #72729] Truncate sv_gets(sv) only when not appending to a string --- sv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sv.c b/sv.c index a069b09..f555fc1 100644 --- a/sv.c +++ b/sv.c @@ -7086,7 +7086,9 @@ Perl_sv_gets(pTHX_ register SV *const sv, register PerlIO *const fp, I32 append) } SvPOK_only(sv); - SvCUR_set(sv,0); + if (!append) { + SvCUR_set(sv,0); + } if (PerlIO_isutf8(fp)) SvUTF8_on(sv); -- 1.8.3.1