]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/42090 (I/O: Problems when reading partial records in formatted direct...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 21 Nov 2009 02:44:01 +0000 (02:44 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 21 Nov 2009 02:44:01 +0000 (02:44 +0000)
2009-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

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

libgfortran/ChangeLog
libgfortran/io/transfer.c

index 2f3accde31bd66b6922563ba9bb2cc172bf98df0..0a4ecaa8fb7450449f82f3926be39f28a7c26c47 100644 (file)
@@ -1,3 +1,12 @@
+2009-11-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       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.
index a93c9b8dcd575bad4e4d43c082e7c87459d672e9..d5c9d4e7edfffc6cb072146cba6c608919c75c9d 100644 (file)
@@ -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: