From 992923053cfb51dc04c6a7ee07ca6fff1b61d1a5 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 18 Jun 1998 07:47:15 +0000 Subject: 1.1b9_26 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 2d35f8355e..0643f21813 100644 --- a/io.c +++ b/io.c @@ -459,7 +459,11 @@ io_gets_method(argc, argv, io) if (!NIL_P(rs)) Check_Type(rs, T_STRING); } - if (!NIL_P(rs)) { + if (NIL_P(rs)) { + rsptr = 0; + rslen = 0; + } + else { rslen = RSTRING(rs)->len; if (rslen == 0) { rsptr = "\n\n"; @@ -473,10 +477,6 @@ io_gets_method(argc, argv, io) rsptr = RSTRING(rs)->ptr; } } - else { - rsptr = 0; - rslen = 0; - } GetOpenFile(io, fptr); io_readable(fptr); -- cgit v1.2.3