diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-11-19 04:50:04 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2009-11-19 04:50:04 +0000 |
commit | 0b4d979f55a573d7b145b6925d3601baa3be50e8 (patch) | |
tree | 8756c0b9e7d7130add2cccaba032e0e9eff9d912 /libgfortran/io | |
parent | 271cb0240a9228022ba3f61cbdd172b2fdf2c62a (diff) | |
download | gcc-0b4d979f55a573d7b145b6925d3601baa3be50e8.tar.gz |
re PR fortran/42090 (I/O: Problems when reading partial records in formatted direct access files)
2009-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/42090
* io/transfer.c (skip_record): Set bytes_left_subrecord to zero after
skipping the remaining bytes in the record.
(next_record_r): Call skip_record with the number of bytes_left to be
skipped.
From-SVN: r154316
Diffstat (limited to 'libgfortran/io')
-rw-r--r-- | libgfortran/io/transfer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index b5f52b1ccf3..a110c6529ff 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2661,6 +2661,8 @@ skip_record (st_parameter_dt *dtp, ssize_t bytes) if (sseek (dtp->u.p.current_unit->s, dtp->u.p.current_unit->bytes_left_subrecord, SEEK_CUR) < 0) generate_error (&dtp->common, LIBERROR_OS, NULL); + + dtp->u.p.current_unit->bytes_left_subrecord = 0; } else { /* Seek by reading data. */ @@ -2741,7 +2743,7 @@ next_record_r (st_parameter_dt *dtp) case FORMATTED_DIRECT: case UNFORMATTED_DIRECT: - skip_record (dtp, 0); + skip_record (dtp, dtp->u.p.current_unit->bytes_left); break; case FORMATTED_STREAM: |