mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* string.c (rb_str_buf_append): fix append itself.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f07c8e6413
commit
fc5a26c2d4
3 changed files with 17 additions and 1 deletions
8
string.c
8
string.c
|
@ -1166,7 +1166,13 @@ rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *ptr_enc)
|
|||
VALUE
|
||||
rb_str_buf_append(VALUE str, VALUE str2)
|
||||
{
|
||||
int str2_cr = ENC_CODERANGE(str2);
|
||||
int str2_cr;
|
||||
|
||||
if (str == str2) {
|
||||
str2 = rb_str_dup(str2);
|
||||
}
|
||||
|
||||
str2_cr = ENC_CODERANGE(str2);
|
||||
|
||||
rb_enc_cr_str_buf_cat(str, RSTRING_PTR(str2), RSTRING_LEN(str2),
|
||||
ENCODING_GET(str2), str2_cr, &str2_cr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue