I believe that it makes little sense for the simple user filters
Nicholas Clark [Sat, 15 Apr 2006 20:19:22 +0000 (20:19 +0000)]
provided by coderefs to be run in block mode. Hence always read from
the upstream filter in line mode, and always call the user's filter
with 1 line.

p4raw-id: //depot/perl@27821

pp_ctl.c

index d7d3fda..43db9de 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4575,7 +4575,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
     SvUPGRADE(upstream, SVt_PV);
        
     if (filter_has_file) {
-       status = FILTER_READ(idx+1, upstream, maxlen);
+       status = FILTER_READ(idx+1, upstream, 0);
     }
 
     assert(filter_sub);
@@ -4590,7 +4590,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
 
        DEFSV = upstream;
        PUSHMARK(SP);
-       PUSHs(sv_2mortal(newSViv(maxlen)));
+       PUSHs(sv_2mortal(newSViv(0)));
        if (filter_state) {
            PUSHs(filter_state);
        }