From: Jerry DeLisle Date: Tue, 14 Oct 2008 01:49:51 +0000 (+0000) Subject: re PR fortran/37083 (Formatted read of line without trailing new-line fails) X-Git-Tag: releases/gcc-4.4.0~2065 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=724cdffe5c30ba0f922c27c1bd2e7ed71e40201c;p=thirdparty%2Fgcc.git re PR fortran/37083 (Formatted read of line without trailing new-line fails) 2008-10-13 Jerry DeLisle PR libfortran/37753 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 76634a3ee25c..00cd841df245 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -242,15 +242,10 @@ next_char (st_parameter_dt *dtp) { if (length == 0) { - if (dtp->u.p.advance_status == ADVANCE_NO) - { - if (dtp->u.p.current_unit->endfile == AT_ENDFILE) - longjmp (*dtp->u.p.eof_jump, 1); - dtp->u.p.current_unit->endfile = AT_ENDFILE; - c = '\n'; - } - else + if (dtp->u.p.current_unit->endfile == AT_ENDFILE) longjmp (*dtp->u.p.eof_jump, 1); + dtp->u.p.current_unit->endfile = AT_ENDFILE; + c = '\n'; } } done: @@ -1913,6 +1908,13 @@ finish_list_read (st_parameter_dt *dtp) c = next_char (dtp); } while (c != '\n'); + + if (dtp->u.p.current_unit->endfile != NO_ENDFILE) + { + generate_error (&dtp->common, LIBERROR_END, NULL); + dtp->u.p.current_unit->endfile = AFTER_ENDFILE; + dtp->u.p.current_unit->current_record = 0; + } } /* NAMELIST INPUT