In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c47992b404786dcb8752239045e21cbcd7e3d103?hp=0ee4a8bde32174274ad80c192e06b5e15d9d0ca4>

- Log -----------------------------------------------------------------
commit c47992b404786dcb8752239045e21cbcd7e3d103
Author: Christian Hansen <[email protected]>
Date:   Sun Mar 25 17:23:39 2012 -0600

    PerlIO-scalar: Fix fail to detect incomplete seqs at EOF
-----------------------------------------------------------------------

Summary of changes:
 ext/PerlIO-scalar/scalar.pm |  2 +-
 ext/PerlIO-scalar/scalar.xs | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ext/PerlIO-scalar/scalar.pm b/ext/PerlIO-scalar/scalar.pm
index 4ed4e4060d..dcba127162 100644
--- a/ext/PerlIO-scalar/scalar.pm
+++ b/ext/PerlIO-scalar/scalar.pm
@@ -1,5 +1,5 @@
 package PerlIO::scalar;
-our $VERSION = '0.24';
+our $VERSION = '0.25';
 require XSLoader;
 XSLoader::load();
 1;
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs
index f3dff499bd..dcb8283e72 100644
--- a/ext/PerlIO-scalar/scalar.xs
+++ b/ext/PerlIO-scalar/scalar.xs
@@ -15,6 +15,19 @@ typedef struct {
     Off_t posn;
 } PerlIOScalar;
 
+IV
+PerlIOScalar_eof(pTHX_ PerlIO * f)
+{
+    if (PerlIOBase(f)->flags & PERLIO_F_CANREAD) {
+        PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
+        char *p;
+        STRLEN len;
+        p = SvPV(s->var, len);
+        return len - (STRLEN)(s->posn) <= 0;
+    }
+    return 1;
+}
+
 static IV
 PerlIOScalar_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg,
                    PerlIO_funcs * tab)
@@ -406,7 +419,7 @@ static PERLIO_FUNCS_DECL(PerlIO_scalar) = {
     PerlIOScalar_close,
     PerlIOScalar_flush,
     PerlIOScalar_fill,
-    PerlIOBase_eof,
+    PerlIOScalar_eof,
     PerlIOBase_error,
     PerlIOBase_clearerr,
     PerlIOBase_setlinebuf,

--
Perl5 Master Repository

Reply via email to