aboutsummaryrefslogtreecommitdiff
path: root/libio/strops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/strops.c')
-rw-r--r--libio/strops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libio/strops.c b/libio/strops.c
index c596315b60..01f8d6eeb7 100644
--- a/libio/strops.c
+++ b/libio/strops.c
@@ -215,6 +215,9 @@ _IO_str_seekoff (fp, offset, dir, mode)
_IO_ssize_t cur_size = _IO_str_count (fp);
_IO_fpos64_t new_pos = EOF;
+ if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET))
+ mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT);
+
/* Move the get pointer, if requested. */
if (mode & _IOS_INPUT)
{