diff mbox

[libfortran] Bug 65596 - [4.9,5.0 Regression] NAMELIST bug with f2003: reads too far

Message ID 55160162.7010600@charter.net
State New
Headers show

Commit Message

Jerry DeLisle March 28, 2015, 1:18 a.m. UTC
At first glance this looked like only a regression in 4.9.  While searching for 
the regression I noticed an error in unit.c (probably a copy/paste error). Upon 
correcting that obvious error, the regression found in 4.9 also appeared in 5.0.

The fix is simple and obvious and I have regression tested on 4.9 and 5.0.

I will commit in the next few days, giving others a chance to review.

New test case attached. I used STOP rather than abort just to change things up a 
bit if the case fails. (yes I could have used -fall-intrinsics)

Regards

Jerry

2015-03-27 Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/65596
	* io/transfer.c (data_transfer_init): If in namelist mode and
	delimiter is not specified, set it to DELIM_QUOTE, independent
	of -std.
	* io/unit.c (init_units): Set flags.delim to the correct
	initial value of DELIM_UNSPECIFIED.
diff mbox

Patch

Index: io/transfer.c
===================================================================
--- io/transfer.c	(revision 221744)
+++ io/transfer.c	(working copy)
@@ -2675,8 +2675,7 @@  data_transfer_init (st_parameter_dt *dtp, int read
   if (dtp->u.p.current_unit->delim_status == DELIM_UNSPECIFIED)
     {
       if (ionml && dtp->u.p.current_unit->flags.delim == DELIM_UNSPECIFIED)
-	dtp->u.p.current_unit->delim_status =
-	  compile_options.allow_std & GFC_STD_GNU ? DELIM_QUOTE : DELIM_NONE;
+	dtp->u.p.current_unit->delim_status = DELIM_QUOTE;
       else
 	dtp->u.p.current_unit->delim_status = dtp->u.p.current_unit->flags.delim;
     }
Index: io/unit.c
===================================================================
--- io/unit.c	(revision 221744)
+++ io/unit.c	(working copy)
@@ -608,7 +608,7 @@  init_units (void)
       u->flags.position = POSITION_ASIS;
       u->flags.sign = SIGN_SUPPRESS;
       u->flags.decimal = DECIMAL_POINT;
-      u->flags.delim = DECIMAL_UNSPECIFIED;
+      u->flags.delim = DELIM_UNSPECIFIED;
       u->flags.encoding = ENCODING_DEFAULT;
       u->flags.async = ASYNC_NO;
       u->flags.round = ROUND_UNSPECIFIED;