From: Yukihiro Matsumoto Date: 2006-12-30T03:47:53+09:00 Subject: Re: unsafe readline(), anything better? Hi, In message "Re: unsafe readline(), anything better?" on Fri, 29 Dec 2006 04:05:11 +0900, Rob Muhlestein 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.