From: Rob Muhlestein Date: 2006-12-30T04:55:04+09:00 Subject: Re: unsafe readline(), anything better? On Fri, 29 Dec 2006 10:49:41 -0500, Rob Muhlestein wrote: > Maybe we could call it SafeReader so we can have its readline calling a > read_until (like I've done in other langs). In my few remaining vacation > hours, I'll try to write up a spec, perhaps in Rspec and post for > comment. Humm, from this last recent ruby CVS commit just today makes me wonder if matz is listening to this thread. If so, matz, thanks for getting me giddy about programming again, and thanks for taking a shot at addressing this! matz 2006-12-30 04:21:50 +0900 (Sat, 30 Dec 2006) New Revision: 11428 Modified files: trunk/ChangeLog trunk/ext/stringio/stringio.c trunk/io.c trunk/version.h Log: * ext/stringio/stringio.c (strio_gets): accepts limit argument. * ext/stringio/stringio.c (strio_readline, strio_each, strio_readlines): ditto. * ext/stringio/stringio.c (strio_getline): add limit capability. * io.c (rb_io_gets_m): accepts limit argument. [ruby-talk:231563] * io.c (rb_io_readline, rb_io_readlines, rb_io_each_line, argf_getline): ditto. * io.c (appendline): add limit capability. * io.c (rb_io_getline_fast, rb_io_getline): ditto. * io.c (rb_io_getline): small refactoring for DRY. * io.c (rb_io_s_foreach, rb_io_s_readlines): small refactoring. -- Rob Muhlestein http://rob.muhlestein.net