From 586f727b8c37630d36618f8f09765b92098af8a0 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 28 Feb 2008 02:25:14 +0000 Subject: * io.c (rb_io_getline_1): get rid of segfault. [ruby-dev:33938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index cd7f0aa07f..cbca404d06 100644 --- a/io.c +++ b/io.c @@ -1960,7 +1960,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io) swallow(fptr, '\n'); } } - str = io_enc_str(str, fptr); + if (!NIL_P(str)) str = io_enc_str(str, fptr); } if (!NIL_P(str)) { -- cgit v1.2.3