]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2008-10-13 Jerry DeLisle <jvdelisle@gcc.gnu.org
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2008 01:49:51 +0000 (01:49 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Oct 2008 01:49:51 +0000 (01:49 +0000)
PR libfortran/37083
* io/list_read.c (next_char): Simplify EOF tests and set endfile flag.
(finish_list_read): Add EOF check.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141101 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/list_read.c

index 8332fea352278b052bdaedd592fc190cc0df92f0..4e72cb8bfc7f814d885572d113410a5cfeb8839f 100644 (file)
@@ -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
index 76634a3ee25ce56f8b465a8fb4f996dadaa1c90c..00cd841df245029977517903ee48ea5b78bdd66e 100644 (file)
@@ -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