]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/26464 (Runtime I/O error/invald argument on READ)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 28 Feb 2006 02:07:00 +0000 (02:07 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Tue, 28 Feb 2006 02:07:00 +0000 (02:07 +0000)
2006-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/26464
* io/file_pos.c (st_backspace): Flush and truncate file
when in AFTER_ENDFILE condition.
* io/transfer.c (st_read_done): Remove flush, no longer needed.

From-SVN: r111506

libgfortran/ChangeLog
libgfortran/io/file_pos.c
libgfortran/io/transfer.c

index a570af48c759a3d9c946e2dca09f48d462630f29..136e85090c26230a7caf2a16e2dbc1b56be70212 100644 (file)
@@ -1,3 +1,10 @@
+2006-02-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/26464
+       * io/file_pos.c (st_backspace): Flush and truncate file
+       when in AFTER_ENDFILE condition.
+       * io/transfer.c (st_read_done): Remove flush, no longer needed.
+
 2006-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/26423
index ba8f63172214dadc589e436fc98064d7f7ba4bb3..8bd364c43842a1113cc878ccd8f5170726a325dc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2003, 2005, 2006 Free Software Foundation, Inc.
    Contributed by Andy Vaught and Janne Blomqvist
 
 This file is part of the GNU Fortran runtime library (libgfortran).
@@ -161,7 +161,11 @@ st_backspace (st_parameter_filepos *fpp)
   /* Check for special cases involving the ENDFILE record first.  */
 
   if (u->endfile == AFTER_ENDFILE)
-    u->endfile = AT_ENDFILE;
+    {
+      u->endfile = AT_ENDFILE;
+      flush (u->s);
+      struncate (u->s);
+    }
   else
     {
       if (file_position (u->s) == 0)
index 093852a99ec7f856fc50eeff0005f475bf723c62..72becd1397261114d409235da6d2f2ccf52bcb14 100644 (file)
@@ -2159,7 +2159,6 @@ export_proto(st_read_done);
 void
 st_read_done (st_parameter_dt *dtp)
 {
-  flush(dtp->u.p.current_unit->s);
   finalize_transfer (dtp);
   free_format_data (dtp);
   free_ionml (dtp);