S_utf16_textfilter() needs FILTER_DATA() to get the filter's state SV.
authorNicholas Clark <nick@ccl4.org>
Wed, 21 Oct 2009 14:19:12 +0000 (15:19 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 21 Oct 2009 14:19:12 +0000 (15:19 +0100)
aa6dbd607b0a3d8a wrongly assumed that the filter's state SV was the SV passed
in as an argument to the filter read function.

toke.c

diff --git a/toke.c b/toke.c
index 7ad492f..39b2e8a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -12776,7 +12776,7 @@ S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen)
     dVAR;
     const STRLEN old = SvCUR(sv);
     const I32 count = FILTER_READ(idx+1, sv, maxlen);
-    const bool reverse = IoLINES(sv);
+    const bool reverse = IoLINES(FILTER_DATA(idx));
 
     /* As we're automatically added, at the lowest level, and hence only called
        from this file, we can be sure that we're not called in block mode. Hence