Hi Janus,
I'm not much of a libgfortran or I/O expert, but after all this looks ok to me. Thanks for the patch!
Committed, thanks. What to people think about backporting to 4.7?
It is a wrong-code issue, if a rather obscure corner.
If there's no feedback within a few days, I think I'll close the PR.
Thomas
