|
|
ce426f |
diff --git glibc-2.17-c758a686/libio/wfileops.c glibc-2.17-c758a686/libio/wfileops.c
|
|
|
ce426f |
index 87d3cdc..877fc1f 100644
|
|
|
ce426f |
--- glibc-2.17-c758a686/libio/wfileops.c
|
|
|
ce426f |
+++ glibc-2.17-c758a686/libio/wfileops.c
|
|
|
ce426f |
@@ -715,7 +715,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
|
|
|
ce426f |
- fp->_wide_data->_IO_write_base) / clen;
|
|
|
ce426f |
else
|
|
|
ce426f |
{
|
|
|
ce426f |
- enum __codecvt_result status;
|
|
|
ce426f |
+ enum __codecvt_result status = __codecvt_ok;
|
|
|
ce426f |
delta = (fp->_wide_data->_IO_write_ptr
|
|
|
ce426f |
- fp->_wide_data->_IO_write_base);
|
|
|
ce426f |
const wchar_t *write_base = fp->_wide_data->_IO_write_base;
|
|
|
ce426f |
@@ -728,9 +728,12 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
|
|
|
ce426f |
flush buffers for every ftell. */
|
|
|
ce426f |
do
|
|
|
ce426f |
{
|
|
|
ce426f |
- /* Ugh, no point trying to avoid the flush. Just do it
|
|
|
ce426f |
- and go back to how it was with the read mode. */
|
|
|
ce426f |
- if (delta > 0 && new_write_ptr == fp->_IO_buf_end)
|
|
|
ce426f |
+ /* There is not enough space in the buffer to do the entire
|
|
|
ce426f |
+ conversion, so there is no point trying to avoid the
|
|
|
ce426f |
+ buffer flush. Just do it and go back to how it was with
|
|
|
ce426f |
+ the read mode. */
|
|
|
ce426f |
+ if (status == __codecvt_partial
|
|
|
ce426f |
+ || (delta > 0 && new_write_ptr == fp->_IO_buf_end))
|
|
|
ce426f |
{
|
|
|
ce426f |
if (_IO_switch_to_wget_mode (fp))
|
|
|
ce426f |
return WEOF;
|