diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-02-28 02:07:00 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2006-02-28 02:07:00 +0000 |
commit | 9985dd8aafd954ba667b41ab3816e9da2bb7027f (patch) | |
tree | 68154040e8d08bfe65e6298573c9cca4d07584ac /libgfortran | |
parent | f2b5129c6db6f547864adbe32d84d401603845e1 (diff) | |
download | gcc-9985dd8aafd954ba667b41ab3816e9da2bb7027f.zip gcc-9985dd8aafd954ba667b41ab3816e9da2bb7027f.tar.gz gcc-9985dd8aafd954ba667b41ab3816e9da2bb7027f.tar.bz2 |
re PR libfortran/26464 (Runtime I/O error/invald argument on READ)
2006-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/26464
* io/file_pos.c (st_backspace): Flush and truncate file
when in AFTER_ENDFILE condition.
* io/transfer.c (st_read_done): Remove flush, no longer needed.
From-SVN: r111506
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 7 | ||||
-rw-r--r-- | libgfortran/io/file_pos.c | 8 | ||||
-rw-r--r-- | libgfortran/io/transfer.c | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index a570af4..136e850 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2006-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/26464 + * io/file_pos.c (st_backspace): Flush and truncate file + when in AFTER_ENDFILE condition. + * io/transfer.c (st_read_done): Remove flush, no longer needed. + 2006-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/26423 diff --git a/libgfortran/io/file_pos.c b/libgfortran/io/file_pos.c index ba8f631..8bd364c 100644 --- a/libgfortran/io/file_pos.c +++ b/libgfortran/io/file_pos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2002-2003, 2005, 2006 Free Software Foundation, Inc. Contributed by Andy Vaught and Janne Blomqvist This file is part of the GNU Fortran runtime library (libgfortran). @@ -161,7 +161,11 @@ st_backspace (st_parameter_filepos *fpp) /* Check for special cases involving the ENDFILE record first. */ if (u->endfile == AFTER_ENDFILE) - u->endfile = AT_ENDFILE; + { + u->endfile = AT_ENDFILE; + flush (u->s); + struncate (u->s); + } else { if (file_position (u->s) == 0) diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 093852a..72becd1 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -2159,7 +2159,6 @@ export_proto(st_read_done); void st_read_done (st_parameter_dt *dtp) { - flush(dtp->u.p.current_unit->s); finalize_transfer (dtp); free_format_data (dtp); free_ionml (dtp); |