From 1859083bc02590623eaa85a5d8c9657311453d02 Mon Sep 17 00:00:00 2001 From: bdavis Date: Wed, 9 Jun 2004 01:03:02 +0000 Subject: 2004-06-09 Bud Davis PR gfortran/14897 * gfortran.fortran-torture/execute/t_edit.f90 * io/transfer.c (formatted_transfer): position is unique for T and TL edit descriptors. (data_transfer_init): set record length to size of internal file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82808 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 8 ++++++++ libgfortran/io/transfer.c | 26 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'libgfortran') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index ab7d37633db..e9f17ee05bd 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,11 @@ +2004-06-09 Bud Davis + + PR gfortran/14897 + * io/transfer.c (formatted_transfer): position is unique + for T and TL edit descriptors. + (data_transfer_init): set record length to size of internal + file. + 2004-06-09 Bud Davis PR gfortran/15755 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index d5ef5c68d7f..04b7c5a7ac2 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -608,14 +608,18 @@ formatted_transfer (bt type, void *p, int len) break; - case FMT_T: - pos = f->u.n ; - pos= current_unit->recl - current_unit->bytes_left - pos; - /* fall through */ - case FMT_TL: - consume_data_flag = 0 ; - pos = f->u.n ; + case FMT_T: + if (f->format==FMT_TL) + { + pos = f->u.n ; + pos= current_unit->recl - current_unit->bytes_left - pos; + } + else // FMT==T + { + consume_data_flag = 0 ; + pos = f->u.n - 1; + } if (pos < 0 || pos >= current_unit->recl ) { @@ -898,8 +902,12 @@ data_transfer_init (int read_flag) if (current_unit == NULL) return; - if (is_internal_unit() && g.mode==WRITING) - empty_internal_buffer (current_unit->s); + if (is_internal_unit()) + { + current_unit->recl = file_length(current_unit->s); + if (g.mode==WRITING) + empty_internal_buffer (current_unit->s); + } /* Check the action */ -- cgit v1.2.1