diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-10-14 01:49:51 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-10-14 01:49:51 +0000 |
commit | 724cdffe5c30ba0f922c27c1bd2e7ed71e40201c (patch) | |
tree | 98ce6c33b70a0f91ec650b18a08e95344f3c7190 /libgfortran | |
parent | f3fd447c9c2b74e03b8555b3b4cc9a6db85ff8f0 (diff) | |
download | gcc-724cdffe5c30ba0f922c27c1bd2e7ed71e40201c.zip gcc-724cdffe5c30ba0f922c27c1bd2e7ed71e40201c.tar.gz gcc-724cdffe5c30ba0f922c27c1bd2e7ed71e40201c.tar.bz2 |
re PR fortran/37083 (Formatted read of line without trailing new-line fails)
2008-10-13 Jerry DeLisle <jvdelisle@gcc.gnu.org
PR libfortran/37083
* io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
(finish_list_read): Add EOF check.
From-SVN: r141101
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 8332fea..4e72cb8 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2008-10-13 Jerry DeLisle <jvdelisle@gcc.gnu.org + + PR libfortran/37083 + * io/list_read.c (next_char): Simplify EOF tests and set endfile flag. + (finish_list_read): Add EOF check. + 2008-10-09 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/37753 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 76634a3..00cd841 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 |