Actions
Bug #1510
closed[patch] String#partition can return wrong result or crash
Description
=begin
The attached patch fixes a problem that occurs when the argument of String#partition needs to be converted using :to_str.
E.g:
class C
def to_str
"foo"
end
end
p "foo-bar".partition(C.new)
Before patch:
["", #<C:0x2c62a8>, "foo-bar"]
After patch:
["", "foo", "-bar"]
RubySpecs has been updated. Without the version guard, it crashes Ruby.
=end
Files
Actions
Like0
Like0Like0