* array.c (rb_ary_join): non-nil separator must be converted to
String. and separators' total length was wrong. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a79f85e6cf
commit
35008e2087
@ -1,3 +1,8 @@
|
|||||||
|
Thu Nov 15 15:29:39 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
|
||||||
|
|
||||||
|
* array.c (rb_ary_join): non-nil separator must be converted to
|
||||||
|
String. and separators' total length was wrong.
|
||||||
|
|
||||||
Thu Nov 15 03:37:17 2001 Usaku Nakamura <usa@ruby-lang.org>
|
Thu Nov 15 03:37:17 2001 Usaku Nakamura <usa@ruby-lang.org>
|
||||||
|
|
||||||
* hash.c (ruby_setenv): remove USE_WIN32_RTL_ENV block since it's
|
* hash.c (ruby_setenv): remove USE_WIN32_RTL_ENV block since it's
|
||||||
|
5
array.c
5
array.c
@ -804,8 +804,9 @@ rb_ary_join(ary, sep)
|
|||||||
len += 10;
|
len += 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!NIL_P(sep) && TYPE(sep) == T_STRING) {
|
if (!NIL_P(sep)) {
|
||||||
len += RSTRING(sep)->len * RARRAY(ary)->len - 1;
|
StringValue(sep);
|
||||||
|
len += RSTRING(sep)->len * (RARRAY(ary)->len - 1);
|
||||||
}
|
}
|
||||||
result = rb_str_buf_new(len);
|
result = rb_str_buf_new(len);
|
||||||
for (i=0; i<RARRAY(ary)->len; i++) {
|
for (i=0; i<RARRAY(ary)->len; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user