aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorBud Davis <bdavis9659@comcast.net>2005-01-16 20:44:01 +0000
committerBud Davis <bdavis9659@comcast.net>2005-01-16 20:44:01 +0000
commit703f46a8adfb36511619cec1f2648e9264dda73a (patch)
tree539669e5c3183f55dfd806145ccc55dc8d00b3ba /libgfortran
parent1f49780501b974c0491ead68f482909b96b712c3 (diff)
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: https://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);