perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r33638 - branches/pdd22io_part2/src/io

Subject: [svn:parrot] r33638 - branches/pdd22io_part2/src/io
From:
Date: Sun, 7 Dec 2008 14:54:57 -0800 PST
Newsgroups: perl.cvs.parrot

Author: allison
Date: Sun Dec  7 14:54:56 2008
New Revision: 33638

Modified:
   branches/pdd22io_part2/src/io/buffer.c

Log:
[pdd22io] Neglected to set cached version of buffer flags when resetting buffer
to empty.


Modified: branches/pdd22io_part2/src/io/buffer.c
==============================================================================
--- branches/pdd22io_part2/src/io/buffer.c      (original)
+++ branches/pdd22io_part2/src/io/buffer.c      Sun Dec  7 14:54:56 2008
@@ -310,19 +310,20 @@
 
         /* buffer completed */
         if (current == avail) {
-            Parrot_io_set_buffer_flags(interp, filehandle,
-                    (buffer_flags & ~PIO_BF_READBUF));
+            buffer_flags &= ~PIO_BF_READBUF;
+            Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
             /* Reset next and end */
             Parrot_io_set_buffer_end(interp, filehandle, NULL);
             Parrot_io_set_buffer_next(interp, filehandle, buffer_start);
         }
 
+        /* requested length satisfied */
         if (len == current) {
             s->strlen = s->bufused = len;
             return current;
         }
         else {
-            /* more data needed from downlayer */
+            /* more data needed */
             out_buf += current;
             len -= current;
         }
@@ -347,7 +348,9 @@
         }
 
         got = Parrot_io_fill_readbuf(interp, filehandle);
-        len = len < got ? len : got;
+        len = (len < got)
+            ? len
+            : (got > 0) ? got : 0;
     }
 
     /* read from the read_buffer */

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r33638 - branches/pdd22io_part2/src/io, allison <=