From ff9bb54ea5a2dc2fd9b7b82bf5a2d007acc1142c Mon Sep 17 00:00:00 2001 From: bdavis Date: Sun, 16 Jan 2005 20:44:01 +0000 Subject: 2005-01-16 Bud Davis PR fortran/18778 * gfortran.dg/endfile_2.f90: New test. * io/transfer.c (us_read): no bytes available is not a runtime error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93737 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/io/transfer.c | 3 +++ 2 files changed, 9 insertions(+) (limited to 'libgfortran') diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index c0534b8ef44..d6bcb8d9cbb 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2004-01-16 Bud Davis + + PR fortran/18778 + * io/transfer.c (us_read): no bytes available is not a + runtime error. + 2005-01-15 Bud Davis PR fortran/18983 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 54544079073..73ae853fc87 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -843,6 +843,9 @@ us_read (void) n = sizeof (gfc_offset); p = salloc_r (current_unit->s, &n); + if (n == 0) + return; /* end of file */ + if (p == NULL || n != sizeof (gfc_offset)) { generate_error (ERROR_BAD_US, NULL); -- cgit v1.2.1