transfer.c (data_transfer_init): Truncate file in sequential WRITE when last_record...
authorPaul Thomas <pault@gcc.gnu.org>
Thu, 4 Aug 2005 20:26:29 +0000 (20:26 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Thu, 4 Aug 2005 20:26:29 +0000 (20:26 +0000)
2005-08-04 Paul Thomas  <pault@gcc.gnu.org>

* transfer.c (data_transfer_init): Truncate file in
sequential WRITE when last_record == 0, rather than
current_record.  Cures problem on RH9.

From-SVN: r102746

libgfortran/ChangeLog
libgfortran/io/transfer.c

index e725012e0f5d0efbede663bef541150816346459..35f21d90eb7f4a2fb9de1683830d75cf07b63dcd 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-04 Paul Thomas  <pault@gcc.gnu.org>
+
+       * transfer.c (data_transfer_init): Truncate file in
+       sequential WRITE when last_record == 0, rather than
+       current_record.  Cures problem on RH9.
+
 2005-08-03  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        * libgfortran.h: When isfinite is not provided by the system,
index 357e090f2b7bbb2c740560f7c507065ae23882da..72cc2b9bcbb3e4aa80fcb3671f4c02e9124de21e 100644 (file)
@@ -1171,7 +1171,7 @@ data_transfer_init (int read_flag)
      it is always safe to truncate the file on the first write */
   if (g.mode == WRITING
       && current_unit->flags.access == ACCESS_SEQUENTIAL
-      && current_unit->current_record == 0)
+      && current_unit->last_record == 0)
        struncate(current_unit->s);
 
   current_unit->mode = g.mode;