------- Comment #20 from potswa at mac dot com 2010-09-10 17:35 ------- (In reply to comment #17)
> The task is to call fseek(0,cur), and then subtract the number of bytes in the > put area plus the "external characters," right? Er, I don't mean "bytes in the put area" exactly, but you know what I mean⦠what I'm asking is, how does your simplification relate to the task of figuring out how many file bytes the buffers hold, without flushing them, which the code does not currently seem designed to do. For regression, note that the code previous to the linked patch was // NB: Need to do this in case _M_file in indeterminate // state, ie _M_file._offset == -1 pos_type __tmp = _M_file.seekoff(__off, ios_base::cur, __mode); if (__tmp >= 0) { // Seek successful. __ret = __tmp; __ret += std::max(this->_M_out_cur, this->_M_in_cur) - _M_filepos; } which does not appear to do multibyte compensation correctly. Was _M_filepos the number of file bytes in whichever area was currently being used? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45628