diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-17 07:31:59 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-17 07:31:59 -0800 |
commit | ad61d6202ad62eba4fd3c97ccba74e26c0cb5ac7 (patch) | |
tree | c97f0847538b84cb42d1f572d3f2e5a262d1438c | |
parent | 89c4dc269d0d6e0b36a4cad0d4cb7d5751daad98 (diff) | |
download | txr-ad61d6202ad62eba4fd3c97ccba74e26c0cb5ac7.tar.gz txr-ad61d6202ad62eba4fd3c97ccba74e26c0cb5ac7.tar.bz2 txr-ad61d6202ad62eba4fd3c97ccba74e26c0cb5ac7.zip |
* stream.c (stdio_seek): Bugfix. Was returning current position
whenever offset is zero, regardless of whence argument.
-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); |