This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libgfortran] PR47667 I/O for reals: READ waits for input after "i" and "n"
- From: Jerry DeLisle <jvdelisle at frontier dot com>
- To: gfortran <fortran at gcc dot gnu dot org>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 11 Feb 2011 15:48:56 -0800
- Subject: [patch, libgfortran] PR47667 I/O for reals: READ waits for input after "i" and "n"
Hi,
The attached patch was regression tested x86-64. This prevents calling eat_line
and waiting for the next line.
We don't really have a wat to do a test case.
OK for trunk?
Regards,
Jerry
2011-02-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/47567
* io/list_read.c (read_real): Check for end of line before calling
eat_line.
Index: io/list_read.c
===================================================================
--- io/list_read.c (revision 170042)
+++ io/list_read.c (working copy)
@@ -1726,8 +1726,9 @@ read_real (st_parameter_dt *dtp, void * dest, int
hit_eof (dtp);
return;
}
- else
+ else if (c != '\n')
eat_line (dtp);
+
sprintf (message, "Bad real number in item %d of list input",
dtp->u.p.item_count);
generate_error (&dtp->common, LIBERROR_READ_VALUE, message);