* file.c (rb_file_join): separator is appended by array length - 1
times. patched by Benoit Daloze [ruby-core:41901] [Bug #5841] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
87fe448091
commit
0d8ad1a96b
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 5 12:15:55 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (rb_file_join): separator is appended by array length - 1
|
||||||
|
times. patched by Benoit Daloze [ruby-core:41901] [Bug #5841]
|
||||||
|
|
||||||
Thu Jan 5 11:47:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
Thu Jan 5 11:47:54 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/uri/common.rb (URI::Parser#initialize_regexp):
|
* lib/uri/common.rb (URI::Parser#initialize_regexp):
|
||||||
|
2
file.c
2
file.c
@ -3825,7 +3825,7 @@ rb_file_join(VALUE ary, VALUE sep)
|
|||||||
}
|
}
|
||||||
if (!NIL_P(sep)) {
|
if (!NIL_P(sep)) {
|
||||||
StringValue(sep);
|
StringValue(sep);
|
||||||
len += RSTRING_LEN(sep) * RARRAY_LEN(ary) - 1;
|
len += RSTRING_LEN(sep) * (RARRAY_LEN(ary) - 1);
|
||||||
}
|
}
|
||||||
result = rb_str_buf_new(len);
|
result = rb_str_buf_new(len);
|
||||||
OBJ_INFECT(result, ary);
|
OBJ_INFECT(result, ary);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user