diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-09 07:54:39 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-11-09 07:54:39 +0000 |
| commit | f5a74b2322b06dee8e85c25733f86de17426218e (patch) | |
| tree | 863ac4b01178b67322702da6e99d200653326663 /io.c | |
| parent | ff1ac7a941f0e3e749050ecd6a154957a2fcdb2b (diff) | |
* io.c (rb_io_each_byte): should update rbuf_off and rbuf_len for
each iteration. [ruby-dev:31659][ruby-dev:32192]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2022,11 +2022,11 @@ rb_io_each_byte(VALUE io) p = fptr->rbuf+fptr->rbuf_off; e = p + fptr->rbuf_len; while (p < e) { + fptr->rbuf_off++; + fptr->rbuf_len--; rb_yield(INT2FIX(*p & 0xff)); p++; } - fptr->rbuf_off += fptr->rbuf_len; - fptr->rbuf_len = 0; rb_io_check_readable(fptr); READ_CHECK(fptr); if (io_fillbuf(fptr) < 0) { |
