summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-04 20:26:29 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-04 20:26:29 +0000
commit185423574d7092df7e8e2c54b41a0c6ae71d4688 (patch)
tree95218ed07dfc78fcbdc06d887a0b5dcf84bb6aa5 /libgfortran
parentcab51b4e4d3e3fb1e2b756e892d24a016a094251 (diff)
downloadgcc-185423574d7092df7e8e2c54b41a0c6ae71d4688.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/transfer.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e725012e0f5..35f21d90eb7 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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,
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 357e090f2b7..72cc2b9bcbb 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -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;