OSDN Git Service

2010-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Mar 2010 02:38:17 +0000 (02:38 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:13:10 +0000 (14:13 +0900)
PR libfortran/43265
* io/io.h: Delete prototype for read_sf, making it static.
* io/read.c (read_x): Modify to call hit_eof if PAD="no".
* io/transfer.c (read_sf_internal): New static function extracted from
read_sf for use on internal units only. Handle empty string case.
(read_sf): New factoring of this function, make it static.  Add special
conditions for EOF based on ADVANCE="no", PAD="no", and whether any
bytes have been previously read from the record.
(read_block_form): Modify to call read_sf or read_sf_internal.
(next_record_r): Add a done flag similar to next_record_w. Call hit_eof
if internal array unit next record returns finished, meaning an EOF was
found and not done, ie not the last record expected.  For external
units call hit_eof if item_count is 1 or there are no pending spaces.
(next_record): Update call to next_record_r.

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

libgfortran/ChangeLog
libgfortran/io/transfer.c

index 8162fa0..af5fefe 100644 (file)
@@ -1,3 +1,20 @@
+2010-03-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libfortran/43265
+       * io/io.h: Delete prototype for read_sf, making it static.
+       * io/read.c (read_x): Modify to call hit_eof if PAD="no".
+       * io/transfer.c (read_sf_internal): New static function extracted from
+       read_sf for use on internal units only. Handle empty string case.
+       (read_sf): New factoring of this function, make it static.  Add special
+       conditions for EOF based on ADVANCE="no", PAD="no", and whether any
+       bytes have been previously read from the record.
+       (read_block_form): Modify to call read_sf or read_sf_internal.
+       (next_record_r): Add a done flag similar to next_record_w. Call hit_eof
+       if internal array unit next record returns finished, meaning an EOF was
+       found and not done, ie not the last record expected.  For external
+       units call hit_eof if item_count is 1 or there are no pending spaces.
+       (next_record): Update call to next_record_r.
+
 2010-03-12  Kai Tietz  <kai.tietz@onevision.com>
 
        PR/42950
index 982d7d0..0f37238 100644 (file)
@@ -191,7 +191,9 @@ current_mode (st_parameter_dt *dtp)
    
 /* Read sequential file - internal unit  */
 
-static char *
+char *
+read_sf_internal (st_parameter_dt *dtp, int * length);
+char *
 read_sf_internal (st_parameter_dt *dtp, int * length)
 {
   static char *empty_string[0];
@@ -2848,14 +2850,9 @@ next_record_r (st_parameter_dt *dtp, int done)
                {
                   if (errno != 0)
                     generate_error (&dtp->common, LIBERROR_OS, NULL);
-                 else
-                   {
-                     if (is_stream_io (dtp)
-                         || dtp->u.p.current_unit->pad_status == PAD_NO
-                         || dtp->u.p.current_unit->bytes_left
-                            == dtp->u.p.current_unit->recl)
-                       hit_eof (dtp);
-                   }
+                 else if (dtp->u.p.item_count == 1
+                          || dtp->u.p.pending_spaces == 0)
+                   hit_eof (dtp);
                  break;
                 }