diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 1ef8416ec83..cbd3e1e171b 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2007-06-10 Jerry DeLisle + + PR libgfortran/32235 + * io/transfer.c (st_read): Remove test for end of file condition. + (next_record_r): Add test for end of file condition. + 2007-06-02 Paolo Bonzini * configure: Regenerate. diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 24bcc5e1a3e..6e3ae30b140 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2268,6 +2268,14 @@ next_record_r (st_parameter_dt *dtp) break; } + + if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL + && !dtp->u.p.namelist_mode + && dtp->u.p.current_unit->endfile == NO_ENDFILE + && (file_length (dtp->u.p.current_unit->s) == + file_position (dtp->u.p.current_unit->s))) + dtp->u.p.current_unit->endfile = AT_ENDFILE; + } @@ -2742,9 +2750,6 @@ st_read (st_parameter_dt *dtp) switch (dtp->u.p.current_unit->endfile) { case NO_ENDFILE: - if (file_length (dtp->u.p.current_unit->s) - == file_position (dtp->u.p.current_unit->s)) - dtp->u.p.current_unit->endfile = AT_ENDFILE; break; case AT_ENDFILE: