This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29053] Consecutive STREAM I/O file positions mixed up
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Sep 2006 13:16:26 -0000
- Subject: [Bug fortran/29053] Consecutive STREAM I/O file positions mixed up
- References: <bug-29053-10743@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2006-09-15 13:16 -------
Subject: Bug 29053
Author: jvdelisle
Date: Fri Sep 15 13:16:15 2006
New Revision: 116970
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116970
Log:
2006-09-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29053
* io.h (gfc_unit): Add variable, strm_pos, to track
STREAM I/O file position.
* file_pos.c (st_rewind): Set strm_pos to beginning.
* open.c (new_unit): Initialize strm_pos.
* read.c (read_x): Bump strm_pos.
* inquire.c (inquire_via_unit): Return strm_pos value.
* transfer.c (read_block),(read_block_direct),(write_block)
(write_buf): Seek to strm_pos - 1. Update strm_pos when done.
(pre_position): Initialize strm_pos.
(data_transfer_init): Set strm_pos if DT_HAS_REC.
(finalize_transfer): Flush file, no need to update strm_pos.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/file_pos.c
trunk/libgfortran/io/inquire.c
trunk/libgfortran/io/io.h
trunk/libgfortran/io/open.c
trunk/libgfortran/io/read.c
trunk/libgfortran/io/transfer.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29053