aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/inquire.c
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-09-15 13:16:15 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-09-15 13:16:15 +0000
commit701306112e8d1d108451bccd58f9ccd84ffe81c1 (patch)
treea336065f8c97480fad109a951d2c4da52142fd4a /libgfortran/io/inquire.c
parent5419bc7f3dbed760ececc639a7aff346da611c58 (diff)
downloadgcc-701306112e8d1d108451bccd58f9ccd84ffe81c1.zip
gcc-701306112e8d1d108451bccd58f9ccd84ffe81c1.tar.gz
gcc-701306112e8d1d108451bccd58f9ccd84ffe81c1.tar.bz2
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/inquire.c')
-rw-r--r--libgfortran/io/inquire.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index 8a24f49..36e43c2 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -149,7 +149,7 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
*iqp->recl_out = (u != NULL) ? u->recl : 0;
if ((cf & IOPARM_INQUIRE_HAS_STRM_POS_OUT) != 0)
- *iqp->strm_pos_out = (u != NULL) ? u->last_record : 0;
+ *iqp->strm_pos_out = (u != NULL) ? u->strm_pos : 0;
if ((cf & IOPARM_INQUIRE_HAS_NEXTREC) != 0)
*iqp->nextrec = (u != NULL) ? u->last_record + 1 : 0;