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_1@52875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2015-12-04 01:56:19 +00:00
parent 1745d2584a
commit 0399a3d47b
4 changed files with 20 additions and 5 deletions

View file

@ -1078,7 +1078,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;
}
@ -1096,7 +1096,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;
}