summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d8aa14071b..b981952a08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
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);