re PR fortran/37083 (Formatted read of line without trailing new-line fails)

2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org

	PR libfortran/37083
	* io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
	(finish_list_read): Add EOF check.

From-SVN: r141101
This commit is contained in:
Jerry DeLisle 2008-10-14 01:49:51 +00:00
parent f3fd447c9c
commit 724cdffe5c
2 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2008-10-13 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37083
* io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
(finish_list_read): Add EOF check.
2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/37753

View File

@ -242,15 +242,10 @@ next_char (st_parameter_dt *dtp)
{
if (length == 0)
{
if (dtp->u.p.advance_status == ADVANCE_NO)
{
if (dtp->u.p.current_unit->endfile == AT_ENDFILE)
longjmp (*dtp->u.p.eof_jump, 1);
dtp->u.p.current_unit->endfile = AT_ENDFILE;
c = '\n';
}
else
if (dtp->u.p.current_unit->endfile == AT_ENDFILE)
longjmp (*dtp->u.p.eof_jump, 1);
dtp->u.p.current_unit->endfile = AT_ENDFILE;
c = '\n';
}
}
done:
@ -1913,6 +1908,13 @@ finish_list_read (st_parameter_dt *dtp)
c = next_char (dtp);
}
while (c != '\n');
if (dtp->u.p.current_unit->endfile != NO_ENDFILE)
{
generate_error (&dtp->common, LIBERROR_END, NULL);
dtp->u.p.current_unit->endfile = AFTER_ENDFILE;
dtp->u.p.current_unit->current_record = 0;
}
}
/* NAMELIST INPUT