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)
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].


No differences found