From: Jerry DeLisle Date: Sun, 10 Jun 2007 22:50:47 +0000 (+0000) Subject: re PR fortran/32235 (incorrectly position text file after backspace) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82fa3fc0d3abf85a2d5e281cc01621fe4177c046;p=gcc.git re PR fortran/32235 (incorrectly position text file after backspace) 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. From-SVN: r125606 --- 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: