summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 31a86da6b9..1e6b26b5e4 100644
--- a/io.c
+++ b/io.c
@@ -1042,6 +1042,7 @@ rb_io_tell(VALUE io)
GetOpenFile(io, fptr);
pos = io_tell(fptr);
if (pos < 0 && errno) rb_sys_fail_path(fptr->pathv);
+ pos -= fptr->rbuf_len;
return OFFT2NUM(pos);
}