summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-16 20:44:01 +0000
committerbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-16 20:44:01 +0000
commitff9bb54ea5a2dc2fd9b7b82bf5a2d007acc1142c (patch)
tree539669e5c3183f55dfd806145ccc55dc8d00b3ba /libgfortran
parent6659f3e5ff27f2454e905b7bc0aaca166396cde2 (diff)
downloadgcc-ff9bb54ea5a2dc2fd9b7b82bf5a2d007acc1142c.tar.gz
2005-01-16 Bud Davis <bdavis9659@comcast.net>
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
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/transfer.c3
2 files changed, 9 insertions, 0 deletions
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 <bdavis9659@comcast.net>
+
+ PR fortran/18778
+ * io/transfer.c (us_read): no bytes available is not a
+ runtime error.
+
2005-01-15 Bud Davis <bdavis9659@comcast.net>
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);