aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/transfer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 7298835..b5b8df4 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Andy Vaught
Namelist transfer functions contributed by Paul Thomas
@@ -1219,11 +1219,17 @@ us_read (st_parameter_dt *dtp)
int n;
gfc_offset i;
+ if (dtp->u.p.current_unit->endfile == AT_ENDFILE)
+ return;
+
n = sizeof (gfc_offset);
p = salloc_r (dtp->u.p.current_unit->s, &n);
if (n == 0)
- return; /* end of file */
+ {
+ dtp->u.p.current_unit->endfile = AT_ENDFILE;
+ return; /* end of file */
+ }
if (p == NULL || n != sizeof (gfc_offset))
{