OSDN Git Service

2010-03-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / libgfortran / io / transfer.c
index 7f6750d..93c0e03 100644 (file)
@@ -2848,9 +2848,14 @@ next_record_r (st_parameter_dt *dtp, int done)
                {
                   if (errno != 0)
                     generate_error (&dtp->common, LIBERROR_OS, NULL);
-                 else if (dtp->u.p.item_count == 1
-                          || dtp->u.p.pending_spaces == 0)
-                   hit_eof (dtp);
+                 else
+                   {
+                     if (is_stream_io (dtp)
+                         || dtp->u.p.current_unit->pad_status == PAD_NO
+                         || dtp->u.p.current_unit->bytes_left
+                            == dtp->u.p.current_unit->recl)
+                       hit_eof (dtp);
+                   }
                  break;
                 }