aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2005-08-04 20:26:29 +0000
committerPaul Thomas <pault@gcc.gnu.org>2005-08-04 20:26:29 +0000
commit9427924ef875340a2563e542e973935b7927e672 (patch)
tree95218ed07dfc78fcbdc06d887a0b5dcf84bb6aa5 /libgfortran/io
parent6d62ac142c6f9c8345767062b2db71a51e734b8f (diff)
downloadgcc-9427924ef875340a2563e542e973935b7927e672.zip
gcc-9427924ef875340a2563e542e973935b7927e672.tar.gz
gcc-9427924ef875340a2563e542e973935b7927e672.tar.bz2
transfer.c (data_transfer_init): Truncate file in sequential WRITE when last_record == 0, rather than current_record.
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
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/transfer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 357e090..72cc2b9 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;