[svn:parrot] r36516 - trunk/src/io
Infinoid at svn.parrot.org
Infinoid at svn.parrot.org
Tue Feb 10 02:09:10 UTC 2009
Author: Infinoid
Date: Tue Feb 10 02:09:09 2009
New Revision: 36516
URL: https://trac.parrot.org/parrot/changeset/36516
Log:
[io] Fix Parrot_io_write_buffer()'s buffer rotation case
In the final block, this function filled the (nearly already full) buffer,
flushed it, and then put the rest of the data into the (now empty) buffer.
However, it didn't set the "buffer has data in it and needs to be flushed"
flag (which had been unset by Parrot_io_flush), and the extra data was
dropped.
Set the flag. This fixes TT #296.
Modified:
trunk/src/io/buffer.c
Modified: trunk/src/io/buffer.c
==============================================================================
--- trunk/src/io/buffer.c Tue Feb 10 02:08:34 2009 (r36515)
+++ trunk/src/io/buffer.c Tue Feb 10 02:09:09 2009 (r36516)
@@ -656,6 +656,9 @@
Parrot_io_get_file_position(interp, filehandle)));
Parrot_io_flush(interp, filehandle);
+ buffer_flags |= PIO_BF_WRITEBUF;
+ Parrot_io_set_buffer_flags(interp, filehandle, buffer_flags);
+
buffer_next = Parrot_io_get_buffer_next(interp, filehandle);
memmove(buffer_start, ((const char *)buffer + avail), diff);
More information about the parrot-commits
mailing list