This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]