aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2014-03-15 15:12:01 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2014-03-15 15:12:01 +0000
commite94710443aa0359d24db682ba8d856776c3dfa1f (patch)
tree22ddb258738eb39ae5fa42da1db96e18c023eef8 /libgfortran
parent68a230443864dcefe9e368997d65e1d1777d6fc8 (diff)
downloadgcc-e94710443aa0359d24db682ba8d856776c3dfa1f.zip
gcc-e94710443aa0359d24db682ba8d856776c3dfa1f.tar.gz
gcc-e94710443aa0359d24db682ba8d856776c3dfa1f.tar.bz2
re PR fortran/58324 (Bogus END-of-line error with list-directed I/O of file without trailing sequential record marker)
2014-03-15 Jerry DeLisle <jvdelisle@gcc.gnu> PR libfortran/58324 * io/list_read.c (finish_list_read): Read one character to check for the end of the file. If it is the end, then issue the file end error message. If not, use eat_line to reach the end without giving error. The next attempt to read will then issue the error as described above. From-SVN: r208591
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog11
-rw-r--r--libgfortran/io/list_read.c13
2 files changed, 19 insertions, 5 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index f32b34c..358a31c 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2014-03-15 Jerry DeLisle <jvdelisle@gcc.gnu>
+
+ PR libfortran/58324
+ * io/list_read.c (finish_list_read): Read one character to check
+ for the end of the file. If it is the end, then issue the file
+ end error message. If not, use eat_line to reach the end
+ without giving error. The next attempt to read will then
+ issue the error as described above.
+
2014-03-12 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/38199
@@ -10,7 +19,7 @@
formatted READ.
* io/list_read.c (finish_list_read): Don't call eat_line for
internal units.
-
+
2014-03-08 Jerry DeLisle <jvdelisle@gcc.gnu>
PR libfortran/38199
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 2467569..caeb41b 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2092,8 +2092,6 @@ list_formatted_read (st_parameter_dt *dtp, bt type, void *p, int kind,
void
finish_list_read (st_parameter_dt *dtp)
{
- int err;
-
free_saved (dtp);
fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
@@ -2106,13 +2104,20 @@ finish_list_read (st_parameter_dt *dtp)
if (!is_internal_unit (dtp))
{
- err = eat_line (dtp);
- if (err == LIBERROR_END)
+ int c;
+ c = next_char (dtp);
+ if (c == EOF)
{
free_line (dtp);
hit_eof (dtp);
+ return;
}
+ if (c != '\n')
+ eat_line (dtp);
}
+
+ free_line (dtp);
+
}
/* NAMELIST INPUT