Commit 04b6b884 by Jerry DeLisle

re PR fortran/33400 (Formatted read fails if line ends without line break)

2007-09-28  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/33400
	* io/list_read.c (next_char): Interpret encountering the end of file the
	first time as an end of line.  Subsequent reads give EOF error.

From-SVN: r128868
parent 80d86013
2007-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33400
* io/list_read.c (next_char): Interpret encountering the end of file the
first time as an end of line. Subsequent reads give EOF error.
2007-09-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33421
......
......@@ -232,8 +232,14 @@ next_char (st_parameter_dt *dtp)
return '\0';
}
if (length == 0)
longjmp (*dtp->u.p.eof_jump, 1);
c = *p;
{
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
c = *p;
}
done:
dtp->u.p.at_eol = (c == '\n' || c == '\r');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment