[hackers] [wmii] [wmiir] Flush conversion buffer on short read. Closes issue #235. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Tue, 20 Sep 2011 05:45:49 +0200 (CEST)

changeset: 2806:1d200a866939
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Mon Sep 19 23:45:42 2011 -0400
files: cmd/wmiir.c
description:
[wmiir] Flush conversion buffer on short read. Closes issue #235.

diff -r b3911f39ceda -r 1d200a866939 cmd/wmiir.c
--- a/cmd/wmiir.c Mon Sep 19 22:06:50 2011 -0400
+++ b/cmd/wmiir.c Mon Sep 19 23:45:42 2011 -0400
@@ -322,8 +322,11 @@
                         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);
Received on Tue Sep 20 2011 - 05:45:49 CEST

This archive was generated by hypermail 2.2.0 : Tue Sep 20 2011 - 05:48:05 CEST