Fix obscure C stdio bug
authorP. F. Chimento <philip.chimento@gmail.com>
Sat, 18 Jun 2011 19:59:33 +0000 (21:59 +0200)
committerP. F. Chimento <philip.chimento@gmail.com>
Sat, 18 Jun 2011 20:09:56 +0000 (22:09 +0200)
commit38218bc5a9a2c0ac25840a9ca52e8e6d7d0123ac
treedb9f336a2cfff60c41e224367de1e26db9d17188
parent1f1c29341f7da406b8cbbe72793eceefcb69d058
Fix obscure C stdio bug

You cannot switch between reading and writing a file stream without a
call to fseek() in between. This borrows Andrew Plotkin's solution of
keeping track of what the last operation was and switching if
necessary.

Fixes #34, together with [743391de].
libchimara/stream.h
libchimara/strio.c