summaryrefslogtreecommitdiff
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
commit586f727b8c37630d36618f8f09765b92098af8a0 (patch)
tree5b6fe6393f2e7ef8464f2259243d1b1649f50ea6 /io.c
parent9a68795300cf21d983c3ce6eafb8529353e37edd (diff)
* 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
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 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)) {