summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-08 10:22:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-08 10:22:15 +0000
commitef816db96f1ec52a537a7623b476639291483fc2 (patch)
tree70ef6b76456edcf29f093137da1a70258b4902b6
parent0123f3a922c677c6117061aa06c9cd3bda55e9c1 (diff)
* ext/iconv/iconv.c (rb_str_derive): uses rb_str_subseq() for byte
length. [ruby-dev:33653] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/iconv/iconv.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a867a5b36a..7b589d8dad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Fri Feb 8 19:19:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Feb 8 19:22:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (rb_str_derive): uses rb_str_subseq() for byte
+ length. [ruby-dev:33653]
* ext/iconv/iconv.c (iconv_convert): added toidx argument to set
encoding of successfully converted string. [ruby-dev:33221]
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 357a666abe..ed46234077 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -319,7 +319,7 @@ rb_str_derive(VALUE str, const char* ptr, int len)
if (NIL_P(str))
return rb_str_new(ptr, len);
if (RSTRING_PTR(str) + RSTRING_LEN(str) == ptr + len)
- ret = rb_str_substr(str, ptr - RSTRING_PTR(str), len);
+ ret = rb_str_subseq(str, ptr - RSTRING_PTR(str), len);
else
ret = rb_str_new(ptr, len);
OBJ_INFECT(ret, str);