From bf187ce8befc5d9e721d2f06c5c4ee7b69bebbf4 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Sat, 19 Sep 2009 04:41:38 +0000 Subject: [PATCH] re PR fortran/41328 (bad iostat when reading DOS file in a character array (non-advancing)) 2009-09-18 Jerry DeLisle PR libgfortran/41328 * io/transfer.c (read_sf): Set at_eof flag on short read if any characters were successfully read so that EOF condition with no EOR marker succeeds. From-SVN: r151877 --- libgfortran/ChangeLog | 7 +++++++ libgfortran/io/transfer.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 346981415f1..af4cbfddcdb 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,10 @@ +2009-09-18 Jerry DeLisle + + PR libgfortran/41328 + * io/transfer.c (read_sf): Set at_eof flag on short read if any + characters were successfully read so that EOF condition with no EOR + marker succeeds. + 2009-09-12 Jerry DeLisle PR libgfortran/41328 diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 2362a154592..4525bb49c88 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -291,7 +291,7 @@ read_sf (st_parameter_dt *dtp, int * length, int no_error) some other stuff. Set the relevant flags. */ if (lorig > *length && !dtp->u.p.sf_seen_eor && !seen_comma) { - if (no_error) + if (n > 0 || no_error) dtp->u.p.at_eof = 1; else {