summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index c20b3ca5..a9be6fd2 100644
--- a/stream.c
+++ b/stream.c
@@ -257,7 +257,7 @@ static val stdio_seek(val stream, cnum offset, enum strm_whence whence)
struct stdio_handle *h = (struct stdio_handle *) stream->co.handle;
if (h->f != 0) {
- if (offset == 0) {
+ if (offset == 0 && whence == strm_cur) {
long where = ftell(h->f);
if (where >= 0)
return num(where);