This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libfortran] [4.4/4.5 Regression] changed BACKSPACE behaviour at end of file.
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 06 Jun 2009 10:16:40 -0700
- Subject: [patch, libfortran] [4.4/4.5 Regression] changed BACKSPACE behaviour at end of file.
The following patch fixes this regression.
Regression tested and NIST tested on x86-64.
OK for trunk and 4.4.1? (with ChangeLog and a test case of course)
Jerry
Index: list_read.c
===================================================================
--- list_read.c (revision 147996)
+++ list_read.c (working copy)
@@ -1687,6 +1687,11 @@ list_formatted_read_scalar (st_parameter
if (setjmp (eof_jump))
{
generate_error (&dtp->common, LIBERROR_END, NULL);
+ if (!is_internal_unit (dtp))
+ {
+ dtp->u.p.current_unit->endfile = AFTER_ENDFILE;
+ dtp->u.p.current_unit->current_record = 0;
+ }
goto cleanup;
}