string.rb: `upto` to break when the string length is longer than `end`.
@@ -457,6 +457,8 @@ class String
break if exclusive and n == 0
yield bs
break if n == 0
+ bsiz = bs.size
+ break if bsiz > max.size || bsiz == 0
bs = bs.succ
end
self
