Mercurial > octave
changeset 24174:cc631e9926e1
Properly restore the input stream pointer at end of textscan (bug #52116 et al.)
* oct-stream.cc (delimited_stream::refresh_buf): Do not update stream pointer
buf_in_file from the current input stream position unless the delimited
stream buffer is completely empty, e.g., at start of processing.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Wed, 27 Sep 2017 03:58:28 -0500 |
parents | 730227072acb |
children | d2ef665c7c91 |
files | libinterp/corefcn/oct-stream.cc |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc Sun Oct 15 21:06:47 2017 +0200 +++ b/libinterp/corefcn/oct-stream.cc Wed Sep 27 03:58:28 2017 -0500 @@ -1475,6 +1475,8 @@ buf_in_file += (idx - buf); memmove (buf, idx, old_remaining); } + else + buf_in_file = i_stream.tellg (); // record for destructor progress_marker -= idx - buf; // where original idx would have been idx = buf; @@ -1482,7 +1484,6 @@ int gcount; // chars read if (! i_stream.eof ()) { - buf_in_file = i_stream.tellg (); // record for destructor i_stream.read (buf + old_remaining, bufsize - old_remaining); gcount = i_stream.gcount (); }