[Bug libfortran/26499] gfortran - End of File incorrectly positioned after binary I/O.

jvdelisle at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 3 23:05:00 GMT 2006



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2006-03-03 23:05 -------
The case in Comment #9 is also very simple.  I got myself again.  I saw this
before, but because I did not have a test case that failed, I left it alone. 
With this fix in file_pos.c all of Dale's rewind tests pass up to number of
operations equals 9 (262144 tests).  I will submit the updated patch soon.

In st_rewind change this:


          if (u->mode == WRITING)
            {
              flush (u->s);
              struncate (u->s);
            }
          u->mode = READING;

to this:
          flush (u->s);
          if (u->mode == WRITING)
            struncate (u->s);
          u->mode = READING;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26499



More information about the Gcc-bugs mailing list