From 0e04dbcc34b9e2b696a0256b01e22ac4039a6aa1 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/stringio/stringio.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e736c48b..8c5156dd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 16 16:20:45 2004 Nobuyoshi Nakada + + * 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 + Tue Nov 16 11:19:07 2004 Nobuyoshi Nakada * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): use diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 790e56760..a6879c052 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