OSDN Git Service

2009-11-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Nov 2009 04:50:04 +0000 (04:50 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 19 Nov 2009 04:50:04 +0000 (04:50 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154316 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/transfer.c

index 3ee0093..8a816fc 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2009-11-02  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * Makefile.am (gfor_io_headers): Add fbuf.h, format.h, unix.h.
index b5f52b1..a110c65 100644 (file)
@@ -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: