Reset variables being initialized by readline before we do possibly blocking I/O
authorJosh ben Jore <jjore@cpan.org>
Tue, 13 Jul 2010 06:56:55 +0000 (23:56 -0700)
committerJosh ben Jore <jjore@cpan.org>
Tue, 13 Jul 2010 06:56:55 +0000 (23:56 -0700)
sv.c

diff --git a/sv.c b/sv.c
index 39689fd..7ba5ab7 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -7040,6 +7040,7 @@ Perl_sv_gets(pTHX_ register SV *const sv, register PerlIO *const fp, I32 append)
     }
 
     SvPOK_only(sv);
+    SvCUR_set(sv,0);
     if (PerlIO_isutf8(fp))
        SvUTF8_on(sv);