summaryrefslogtreecommitdiff
path: root/libgfortran/io/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/read.c')
-rw-r--r--libgfortran/io/read.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index a4c4a58b7bf..078c6e25fc8 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -1047,11 +1047,22 @@ read_x (st_parameter_dt *dtp, int n)
}
p = fbuf_read (dtp->u.p.current_unit, &length);
- if (p == NULL || (length == 0 && dtp->u.p.item_count == 1))
+ if (p == NULL)
{
hit_eof (dtp);
return;
}
+
+ if (length == 0 && dtp->u.p.item_count == 1)
+ {
+ if (dtp->u.p.current_unit->pad_status == PAD_NO)
+ {
+ hit_eof (dtp);
+ return;
+ }
+ else
+ return;
+ }
n = 0;
while (n < length)