+2019-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/88776
+ * gfortran.dg/namelist_96.f90: New test.
+
2019-01-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/35031
+2019-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/88776
+ * io/list_read.c (namelist_read): Use nml_err_ret path on read error
+ not based on stdin_unit.
+ * io/open.c (newunit): Free format buffer if the unit specified is for
+ stdin, stdout, or stderr.
+
2018-12-06 Janne Blomqvist <jb@gcc.gnu.org>
Backport from trunk
while (!dtp->u.p.input_complete)
{
if (!nml_get_obj_data (dtp, &prev_nl, nml_err_msg, sizeof nml_err_msg))
- {
- if (dtp->u.p.current_unit->unit_number != options.stdin_unit)
- goto nml_err_ret;
- generate_error (&dtp->common, LIBERROR_READ_VALUE, nml_err_msg);
- }
+ goto nml_err_ret;
/* Reset the previous namelist pointer if we know we are not going
to be doing multiple reads within a single namelist object. */
if (u2 != NULL)
unlock_unit (u2);
+ /* If the unit specified is preconnected with a file specified to be open,
+ then clear the format buffer. */
+ if ((opp->common.unit == options.stdin_unit ||
+ opp->common.unit == options.stdout_unit ||
+ opp->common.unit == options.stderr_unit)
+ && (opp->common.flags & IOPARM_OPEN_HAS_FILE) != 0)
+ fbuf_destroy (u);
+
/* Open file. */
s = open_external (opp, flags);