From 89182621d9949b24e67d48b751a1997e9eeb06ec Mon Sep 17 00:00:00 2001 From: glass Date: Thu, 27 Dec 2012 12:21:17 +0000 Subject: * ext/stringio/stringio.c (strio_getline): fix not to raise TypeError when limit is nil. [Bug #7232] [ruby-core:48531] * test/stringio/test_stringio.rb: a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/stringio') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 501c7ddddf..26872e0978 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -987,7 +987,7 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr) case 2: if (!NIL_P(str)) StringValue(str); - limit = NUM2LONG(lim); + if (!NIL_P(lim)) limit = NUM2LONG(lim); break; } -- cgit v1.2.3