Commit 73af0c7b by Jerry DeLisle

re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file)

2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>

	PR fortran/92100
	io/transfer.c (data_transfer_init_worker): Use fbuf_reset
	instead of fbuf_flush before the seek. Note that fbuf_reset
	calls fbuf_flush and adjusts fbuf pointers.

From-SVN: r278660
parent 859174c8
2019-11-24 Jerry DeLisle <jvdelisle@gcc.ngu.org>
PR fortran/92100
io/transfer.c (data_transfer_init_worker): Use fbuf_reset
instead of fbuf_flush before the seek. Note that fbuf_reset
calls fbuf_flush and adjusts fbuf pointers.
2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org> 2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de> Harald Anlauf <anlauf@gmx.de>
......
...@@ -3309,8 +3309,9 @@ data_transfer_init_worker (st_parameter_dt *dtp, int read_flag) ...@@ -3309,8 +3309,9 @@ data_transfer_init_worker (st_parameter_dt *dtp, int read_flag)
if (dtp->pos != dtp->u.p.current_unit->strm_pos) if (dtp->pos != dtp->u.p.current_unit->strm_pos)
{ {
fbuf_flush (dtp->u.p.current_unit, dtp->u.p.mode); fbuf_reset (dtp->u.p.current_unit);
if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1, SEEK_SET) < 0) if (sseek (dtp->u.p.current_unit->s, dtp->pos - 1,
SEEK_SET) < 0)
{ {
generate_error (&dtp->common, LIBERROR_OS, NULL); generate_error (&dtp->common, LIBERROR_OS, NULL);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment