1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2004-11-16 07:21:21 +00:00
parent b93479b8d9
commit 2d28e9d55b
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Nov 16 16:20:45 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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 13:35:54 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::options): add

View file

@ -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);