re PR libfortran/46373 (fflush called when reading from a string)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 9 Nov 2010 13:51:57 +0000 (13:51 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 9 Nov 2010 13:51:57 +0000 (13:51 +0000)
2010-11-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/46373
* io/transfer.c (data_transfer_init): Do not call flush_if_preconnected
if this is an internal unit.

From-SVN: r166490

libgfortran/ChangeLog
libgfortran/io/transfer.c

index f7fe9e1d39128199e0d1a9f2fcf2d291c3378ada..8e511901ce0679a6e2bc3b402cc9a5540fac2e06 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-09  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/46373
+       * io/transfer.c (data_transfer_init): Do not call flush_if_preconnected
+       if this is an internal unit.
+
 2010-11-04  Janne Blomqvist  <jb@gcc.gnu.org>
 
        PR libfortran/44931
index 05425ca2515bb7b0ebca5146871e3dd95727e9b5..6f13113c6b2d749d19655c39a62f7f4fe02d3d01 100644 (file)
@@ -2646,7 +2646,8 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
     }
 
   /* Bugware for badly written mixed C-Fortran I/O.  */
-  flush_if_preconnected(dtp->u.p.current_unit->s);
+  if (!is_internal_unit (dtp))
+    flush_if_preconnected(dtp->u.p.current_unit->s);
 
   dtp->u.p.current_unit->mode = dtp->u.p.mode;