https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92100
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |jvdelisle at gcc dot gnu.org --- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- Patch: diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 6382d0dad09..bb104db3584 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -3273,8 +3273,9 @@ data_transfer_init_worker (st_parameter_dt *dtp, int read_flag) if (dtp->pos != dtp->u.p.current_unit->strm_pos) { - fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode); - if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1, SEEK_SET) < 0) + fbuf_reset (dtp->u.p.current_unit); + if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1, + SEEK_SET) < 0) { generate_error (&dtp->common, LIBERROR_OS, NULL); return;