summaryrefslogtreecommitdiff
path: root/ext/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 07:21:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-16 07:21:21 +0000
commit549bdb3b0ee8b82adb6ad03d79b1ab2c69b7a0c9 (patch)
treefe83e827bd3f819b6b66236b4adab2c3739a33be /ext/stringio
parent8e4ff320023134a902c1716c4e37427796fa6a34 (diff)
* ext/stringio/stringio.c (strio_read): position was ignored when a
buffer was passed. http://www.yo.rim.or.jp/~nov/d/?date=20041116#p03 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 790e567608..a6879c052f 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -889,7 +889,7 @@ strio_read(argc, argv, self)
long rest = RSTRING(ptr->string)->len - ptr->pos;
if (len > rest) len = rest;
rb_str_resize(str, len);
- MEMCPY(RSTRING(str)->ptr, RSTRING(ptr->string)->ptr, char, len);
+ MEMCPY(RSTRING(str)->ptr, RSTRING(ptr->string)->ptr + ptr->pos, char, len);
}
if (NIL_P(str)) {
if (!(ptr->flags & STRIO_EOF)) str = rb_str_new(0, 0);