Permalink
Browse files

[wmiir] Flush conversion buffer on short read. Closes issue #235.

  • Loading branch information...
1 parent e97f133 commit 4323b0691b5ad4bf2f6796a04af2f46421ff81cc Kris Maglione committed Sep 20, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 cmd/wmiir.c
View
@@ -322,8 +322,11 @@ xread(int argc, char *argv[]) {
fatal("Can't open file '%s': %r\n", file);
buf = emalloc(fid->iounit);
- while((count = ixp_read(fid, buf, fid->iounit)) > 0)
+ while((count = ixp_read(fid, buf, fid->iounit)) > 0) {
unflush(1, buf, count, binary);
+ if (!binary && count < fid->iounit)
+ unflush(1, 0, 0, binary);
+ }
if(!binary)
unflush(1, 0, 0, binary);
ixp_close(fid);

0 comments on commit 4323b06

Please sign in to comment.