aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-09-28 16:55:07 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-09-28 16:55:07 +0000
commit04b6b884cdb9370ace48a0f685f06e951711802a (patch)
treee3f51a88f8c0f0e33f80754e7747ac1bace2f145 /libgfortran
parent80d860132a4c15fa2f614d1c557ab2f8ba207f3e (diff)
downloadgcc-04b6b884cdb9370ace48a0f685f06e951711802a.zip
gcc-04b6b884cdb9370ace48a0f685f06e951711802a.tar.gz
gcc-04b6b884cdb9370ace48a0f685f06e951711802a.tar.bz2
re PR fortran/33400 (Formatted read fails if line ends without line break)
2007-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/33400 * io/list_read.c (next_char): Interpret encountering the end of file the first time as an end of line. Subsequent reads give EOF error. From-SVN: r128868
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/list_read.c10
2 files changed, 14 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index aba6b2e..aaa37a4 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/33400
+ * io/list_read.c (next_char): Interpret encountering the end of file the
+ first time as an end of line. Subsequent reads give EOF error.
+
2007-09-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33421
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b97130b..0eb1845 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -232,8 +232,14 @@ next_char (st_parameter_dt *dtp)
return '\0';
}
if (length == 0)
- longjmp (*dtp->u.p.eof_jump, 1);
- c = *p;
+ {
+ 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
+ c = *p;
}
done:
dtp->u.p.at_eol = (c == '\n' || c == '\r');