summaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-06 14:39:51 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-06 14:39:51 +0000
commit9cf84f96b578357cf8cc35cb019efd824f2acb7f (patch)
treed35d48b459f465cd90ff8223cc48ff8ea36e0026 /libgfortran/io
parentb649e510b87ab729cf77a85d8ec561029b414a65 (diff)
downloadgcc-9cf84f96b578357cf8cc35cb019efd824f2acb7f.tar.gz
2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran * io/transfer.c (read_sf): Handle EOR and EOF conditions for ADVANCE="no" with PAD="yes" or PAD="no". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156540 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/transfer.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index a110c6529ff..e627a1c7590 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -305,7 +305,20 @@ read_sf (st_parameter_dt *dtp, int * length, int no_error)
if (lorig > *length && !dtp->u.p.sf_seen_eor && !seen_comma)
{
if (n > 0 || no_error)
- dtp->u.p.at_eof = 1;
+ {
+ if (dtp->u.p.advance_status == ADVANCE_NO)
+ {
+ if (dtp->u.p.current_unit->pad_status == PAD_NO)
+ {
+ hit_eof (dtp);
+ return NULL;
+ }
+ else
+ dtp->u.p.eor_condition = 1;
+ }
+ else
+ dtp->u.p.at_eof = 1;
+ }
else
{
hit_eof (dtp);