summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 02:25:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 02:25:14 +0000
commit5b652b44128482f6b6dcaed4bad94f838b43b972 (patch)
tree5b6fe6393f2e7ef8464f2259243d1b1649f50ea6 /io.c
parente68426afd76f0cc8b4af7ac3c5867a5e3aec353f (diff)
downloadruby-5b652b44128482f6b6dcaed4bad94f838b43b972.tar.gz
ruby-5b652b44128482f6b6dcaed4bad94f838b43b972.tar.xz
ruby-5b652b44128482f6b6dcaed4bad94f838b43b972.zip
* io.c (rb_io_getline_1): get rid of segfault. [ruby-dev:33938]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index cd7f0aa07..cbca404d0 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)) {