I plan to commit the following as simple. The issue was a value was being modified on a short namelist read. After tthe first read gives the correct EOF, a second read would give the error but modify the variable. diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c index 82664dc5f98..36d025949c2 100644 --- a/libgfortran/io/unit.c +++ b/libgfortran/io/unit.c @@ -504,6 +504,7 @@ set_internal_unit (st_parameter_dt *dtp, gfc_unit *iunit, int kind) iunit->current_record=0; iunit->read_bad = 0; iunit->endfile = NO_ENDFILE; + iunit->last_char = 0; /* Set flags for the internal unit. */ The revised test case attached. It has been regression tested OK. Regards, Jerry