mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/77707 (formatted direct access: nextrec off by one)
2016-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/77707 io/transfer.c (next_record): Flush before calculating next_record. Correctly calculate. From-SVN: r240592
This commit is contained in:
parent
4b3906980a
commit
b89f743da8
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-09-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR libgfortran/77707
|
||||||
|
io/transfer.c (next_record): Flush before calculating next_record.
|
||||||
|
Correctly calculate.
|
||||||
|
|
||||||
2016-09-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
2016-09-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||||
|
|
||||||
PR libgfortran/48298
|
PR libgfortran/48298
|
||||||
|
|
|
||||||
|
|
@ -3720,6 +3720,8 @@ next_record (st_parameter_dt *dtp, int done)
|
||||||
else
|
else
|
||||||
next_record_w (dtp, done);
|
next_record_w (dtp, done);
|
||||||
|
|
||||||
|
fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
|
||||||
|
|
||||||
if (!is_stream_io (dtp))
|
if (!is_stream_io (dtp))
|
||||||
{
|
{
|
||||||
/* Since we have changed the position, set it to unspecified so
|
/* Since we have changed the position, set it to unspecified so
|
||||||
|
|
@ -3733,8 +3735,8 @@ next_record (st_parameter_dt *dtp, int done)
|
||||||
fp = stell (dtp->u.p.current_unit->s);
|
fp = stell (dtp->u.p.current_unit->s);
|
||||||
/* Calculate next record, rounding up partial records. */
|
/* Calculate next record, rounding up partial records. */
|
||||||
dtp->u.p.current_unit->last_record =
|
dtp->u.p.current_unit->last_record =
|
||||||
(fp + dtp->u.p.current_unit->recl - 1) /
|
(fp + dtp->u.p.current_unit->recl) /
|
||||||
dtp->u.p.current_unit->recl;
|
dtp->u.p.current_unit->recl - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dtp->u.p.current_unit->last_record++;
|
dtp->u.p.current_unit->last_record++;
|
||||||
|
|
@ -3743,7 +3745,6 @@ next_record (st_parameter_dt *dtp, int done)
|
||||||
if (!done)
|
if (!done)
|
||||||
pre_position (dtp);
|
pre_position (dtp);
|
||||||
|
|
||||||
fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode);
|
|
||||||
smarkeor (dtp->u.p.current_unit->s);
|
smarkeor (dtp->u.p.current_unit->s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue