[EMAIL PROTECTED] wrote:

> geoff       2002/08/07 12:39:00
> 
>   Modified:    .        STATUS
>   Log:
>   added bug report for print not looking at $\

the below patch seems to work, though I need to trace through the 
rwrite_neg_trace() stuff to see what it actually does :)  no 
guarantees here, just some fiddling.

at any rate, if somebody who knows more about the perl API and XS 
wants to use this as a starting point, feel free.  I'm still unsure 
about whether we want to implement this at all, but I had some free 
time and...

--Geoff

Index: Apache.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.125
diff -u -r1.125 Apache.xs
--- Apache.xs   6 Jul 2001 20:33:35 -0000       1.125
+++ Apache.xs   9 Aug 2002 17:44:00 -0000
@@ -1160,6 +1160,7 @@

      PREINIT:
      int i;
+    int sent = 0;
      char * buffer;
      STRLEN len;

@@ -1170,7 +1171,6 @@
          XSRETURN_IV(0);

      for(i = 1; i <= items - 1; i++) {
-       int sent = 0;
          SV *sv = SvROK(ST(i)) && (SvTYPE(SvRV(ST(i))) == SVt_PV) ?
                   (SV*)SvRV(ST(i)) : ST(i);
         buffer = SvPV(sv, len);
@@ -1197,6 +1197,13 @@
          RETVAL += sent;
  #endif
      }
+
+    buffer = SvPV(GvSV(gv_fetchpv("\\", TRUE, SVt_PV)), len);
+
+    if((sent = rwrite(buffer, len, r)) < 0) {
+        rwrite_neg_trace(r);
+    }
+    RETVAL += sent;

      OUTPUT:
      RETVAL

Reply via email to