diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | stream.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2013-12-17 Kaz Kylheku <kaz@kylheku.com> + * stream.c (stdio_seek): Bugfix. Was returning current position + whenever offset is zero, regardless of whence argument. + +2013-12-17 Kaz Kylheku <kaz@kylheku.com> + * parser.y (yybadtoken): Handle HASH_H. 2013-12-17 Kaz Kylheku <kaz@kylheku.com> @@ -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); |