mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0123f3a922
commit
ef816db96f
2 changed files with 5 additions and 2 deletions
|
@ -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]
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue