diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-09-15 13:16:15 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-09-15 13:16:15 +0000 |
commit | 701306112e8d1d108451bccd58f9ccd84ffe81c1 (patch) | |
tree | a336065f8c97480fad109a951d2c4da52142fd4a /libgfortran/io/file_pos.c | |
parent | 5419bc7f3dbed760ececc639a7aff346da611c58 (diff) | |
download | gcc-701306112e8d1d108451bccd58f9ccd84ffe81c1.tar.gz |
re PR fortran/29053 (Consecutive STREAM I/O file positions mixed up)
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.
From-SVN: r116970
Diffstat (limited to 'libgfortran/io/file_pos.c')
-rw-r--r-- | libgfortran/io/file_pos.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c index 3f6a332d979..979dec55513 100644 --- a/libgfortran/io/file_pos.c +++ b/libgfortran/io/file_pos.c @@ -312,6 +312,7 @@ st_rewind (st_parameter_filepos *fpp) u->endfile = NO_ENDFILE; u->current_record = 0; u->bytes_left = 0; + u->strm_pos = 1; u->read_bad = 0; test_endfile (u); } |