From 2d28e9d55b124b895d34fe41dbe6d362c2a88327 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Nov 2004 07:21:21 +0000 Subject: * 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/trunk@7281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/stringio') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 71e14bd85a..89d2f06290 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); -- cgit v1.2.3