[patch,libgfortran] PR25550 file data corrupted after reading end of file.
Jerry DeLisle
jvdelisle@verizon.net
Tue Dec 27 06:22:00 GMT 2005
:ADDPATCH fortran:
The below patch is "simple and maybe not so obvious" but it fixes the problem!
Will commit in 24 hours unless otherwise notified to trunk, and then to 4.1 a
bit later.
NIST tested, regression tested.
2005-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/25550
* io/file_pos.c (st_rewind): Reset bytes left so no error occurs in
next_record_r.
Index: io/file_pos.c
===================================================================
*** io/file_pos.c (revision 109064)
--- io/file_pos.c (working copy)
*************** st_rewind (st_parameter_filepos *fpp)
*** 255,260 ****
--- 255,261 ----
u->endfile = NO_ENDFILE;
u->current_record = 0;
+ u->bytes_left = 0;
test_endfile (u);
}
/* Update position for INQUIRE. */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: endfile.f
Type: text/x-fortran
Size: 450 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20051227/3459e3cf/attachment.bin>
More information about the Gcc-patches
mailing list