merge revision(s) 52868: [Backport #11767]

* range.c (range_to_s): should be infected by the receiver.
	  str2 infects by appending.  [ruby-core:71811] [Bug #11767]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2015-12-03 17:56:53 +00:00
parent 8458ff3a41
commit c35409c276
4 changed files with 20 additions and 5 deletions

View file

@ -1085,7 +1085,7 @@ range_to_s(VALUE range)
str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
rb_str_append(str, str2);
OBJ_INFECT(str, str2);
OBJ_INFECT(str, range);
return str;
}
@ -1103,7 +1103,7 @@ inspect_range(VALUE range, VALUE dummy, int recur)
str = rb_str_dup(str);
rb_str_cat(str, "...", EXCL(range) ? 3 : 2);
rb_str_append(str, str2);
OBJ_INFECT(str, str2);
OBJ_INFECT(str, range);
return str;
}