OSDN Git Service

2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Feb 2010 14:39:51 +0000 (14:39 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Feb 2010 14:39:51 +0000 (14:39 +0000)
PR libfortran
* io/transfer.c (read_sf): Handle EOR and EOF conditions for
ADVANCE="no" with PAD="yes" or PAD="no".

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

libgfortran/ChangeLog
libgfortran/io/transfer.c

index c77b018..be54763 100644 (file)
@@ -1,3 +1,9 @@
+2010-02-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran
+       * io/transfer.c (read_sf): Handle EOR and EOF conditions for
+       ADVANCE="no" with PAD="yes" or PAD="no".
+
 2010-02-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libfortran/42901
index a110c65..e627a1c 100644 (file)
@@ -305,7 +305,20 @@ read_sf (st_parameter_dt *dtp, int * length, int no_error)
   if (lorig > *length && !dtp->u.p.sf_seen_eor && !seen_comma)
     {
       if (n > 0 || no_error)
-        dtp->u.p.at_eof = 1;
+        {
+         if (dtp->u.p.advance_status == ADVANCE_NO)
+           {
+             if (dtp->u.p.current_unit->pad_status == PAD_NO)
+               {
+                 hit_eof (dtp);
+                 return NULL;
+               }
+             else
+               dtp->u.p.eor_condition = 1;
+           }
+         else
+           dtp->u.p.at_eof = 1;
+       }
       else
         {
           hit_eof (dtp);