Yukihiro Matsumoto
12/29/2006 6:48:00 PM
Hi,
In message "Re: unsafe readline(), anything better?"
on Fri, 29 Dec 2006 04:05:11 +0900, Rob Muhlestein <rmuhlestein@yahoo.com> writes:
|If there is enough interest, maybe I'll hack a readmaxline() method into
|an IO patch to submit. Actually, on second thought, how about adding a
|second parameter:
|
| ios.readline(sep_string=$/,maxlen=nil)
|
|The tough question would then be whether to raise an LineTooLong exception
|or just return what could be read of the line up to that point.
I have added the second optional argument to specify maximum length
limit for gets, readline, readlines, etc. I will commit the change
for HEAD soon. Webrick and others should be updated using the new
feature.
matz.