about summary refs log tree commit diff
path: root/libio/wfileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/wfileops.c')
-rw-r--r--libio/wfileops.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libio/wfileops.c b/libio/wfileops.c
index e9fe55bba5..02933b730e 100644
--- a/libio/wfileops.c
+++ b/libio/wfileops.c
@@ -674,7 +674,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
 						   + (sizeof (buffer)
 						      / sizeof (buffer[0])),
 						   &ignore);
-		  if (status !=  __codecvt_ok && status != __codecvt_partial)
+		  if (status != __codecvt_ok && status != __codecvt_partial)
 		    {
 		      fp->_flags |= _IO_ERR_SEEN;
 		      goto dumb;
@@ -682,6 +682,10 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
 		}
 	      while (read_ptr_copy != fp->_IO_read_ptr);
 
+	      fp->_offset = (fp->_offset
+			     - (fp->_IO_read_end - fp->_IO_read_base)
+			     + rel_offset);
+
 	      fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end
 		= fp->_wide_data->_IO_read_base;