re PR libfortran/23154 (Currupt string and segfault in formatted read.)
authorJerry DeLisle <jvdelisle@verizon.net>
Tue, 9 Aug 2005 01:56:04 +0000 (01:56 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 9 Aug 2005 01:56:04 +0000 (01:56 +0000)
2005-08-08  Jerry DeLisle  <jvdelisle@verizon.net>

        PR libfortran/23154
        * io/transfer.c (data_transfer_init): Initialize
        current_unit->bytes_left for a read.

From-SVN: r102893

libgfortran/ChangeLog
libgfortran/io/transfer.c

index aed0280b7c1357dbf53e171abfb37b1b347cbc4a..d733fa36b6cd2414415d085ebf5ba89f1a2bb9eb 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-08  Jerry DeLisle  <jvdelisle@verizon.net>
+
+        PR libfortran/23154
+        * io/transfer.c (data_transfer_init): Initialize
+        current_unit->bytes_left for a read.
+        
 2005-08-07  Janne Blomqvist  <jblomqvi@cc.hut.fi>
 
        PR fortran/22390
index 72cc2b9bcbb3e4aa80fcb3671f4c02e9124de21e..00e8c3101d1b2ca8b0eab637d8b818e9da3e2e3b 100644 (file)
@@ -1028,7 +1028,9 @@ data_transfer_init (int read_flag)
     {
       current_unit->recl = file_length(current_unit->s);
       if (g.mode==WRITING)
-       empty_internal_buffer (current_unit->s);
+        empty_internal_buffer (current_unit->s);
+      else
+        current_unit->bytes_left = current_unit->recl; 
     }
 
   /* Check the action.  */