From: Jerry DeLisle Date: Sat, 21 Nov 2009 02:44:01 +0000 (+0000) Subject: re PR fortran/42090 (I/O: Problems when reading partial records in formatted direct... X-Git-Tag: releases/gcc-4.3.5~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec1bd1554ca0f197e215e9142fc3d211b6167b85;p=thirdparty%2Fgcc.git re PR fortran/42090 (I/O: Problems when reading partial records in formatted direct access files) 2009-11-20 Jerry DeLisle PR libgfortran/42090 Backport from trunk. * 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: r154397 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 2f3accde31bd..0a4ecaa8fb74 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,12 @@ +2009-11-20 Jerry DeLisle + + PR libgfortran/42090 + Backport from trunk. + * 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. + 2009-08-04 Release Manager * GCC 4.3.4 released. diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index a93c9b8dcd57..d5c9d4e7edff 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2186,6 +2186,8 @@ skip_record (st_parameter_dt *dtp, size_t bytes) only I/O errors. */ if (sseek (dtp->u.p.current_unit->s, new) == FAILURE) generate_error (&dtp->common, LIBERROR_OS, NULL); + + dtp->u.p.current_unit->bytes_left_subrecord = 0; } else { /* Seek by reading data. */ @@ -2258,7 +2260,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: