* io/transfer.c (data_transfer_init): truncate an existing
file on the first write.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97937
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-04-09 Bud Davis <bdavis@gfortran.org>
+ Steven G. Kargl <kargls@comcast.net>
+
+ PR fortran/19872
+ * io/transfer.c (data_transfer_init): truncate an existing
+ file on the first write.
+
2005-04-09 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/19106
generate_error (ERROR_OS, NULL);
}
+ /* Overwriting an existing sequential file ?
+ 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)
+ struncate(current_unit->s);
+
current_unit->mode = g.mode;
/* Set the initial value of flags. */