]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/32235 (incorrectly position text file after backspace)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 10 Jun 2007 22:50:47 +0000 (22:50 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sun, 10 Jun 2007 22:50:47 +0000 (22:50 +0000)
2007-06-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/32235
* io/transfer.c (st_read): Remove test for end of file condition.
(next_record_r): Add test for end of file condition.

From-SVN: r125606

libgfortran/ChangeLog
libgfortran/io/transfer.c

index 1ef8416ec83887d19341c722a8369518731f7e1c..cbd3e1e171ba634fb39f5552d02f6f68d1394ac3 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-10  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/32235
+       * io/transfer.c (st_read): Remove test for end of file condition.
+       (next_record_r): Add test for end of file condition.
+
 2007-06-02  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure: Regenerate.
index 24bcc5e1a3eea5ada7fe18e5408788d0a63c10e1..6e3ae30b140cddf5f68da5fafc1f7e9f1b90d585 100644 (file)
@@ -2268,6 +2268,14 @@ next_record_r (st_parameter_dt *dtp)
 
       break;
     }
+
+  if (dtp->u.p.current_unit->flags.access == ACCESS_SEQUENTIAL
+      && !dtp->u.p.namelist_mode
+      && dtp->u.p.current_unit->endfile == NO_ENDFILE
+      && (file_length (dtp->u.p.current_unit->s) ==
+        file_position (dtp->u.p.current_unit->s)))
+    dtp->u.p.current_unit->endfile = AT_ENDFILE;
+
 }
 
 
@@ -2742,9 +2750,6 @@ st_read (st_parameter_dt *dtp)
     switch (dtp->u.p.current_unit->endfile)
       {
       case NO_ENDFILE:
-       if (file_length (dtp->u.p.current_unit->s)
-           == file_position (dtp->u.p.current_unit->s))
-         dtp->u.p.current_unit->endfile = AT_ENDFILE;
        break;
 
       case AT_ENDFILE: