mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (prepare_getline_args): check if rs is a string when non-nil
lim is given. [ruby-dev:35610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1b16c560e4
commit
c98b3a7e19
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Jul 21 10:25:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (prepare_getline_args): check if rs is a string when non-nil
|
||||
lim is given. [ruby-dev:35610]
|
||||
|
||||
Mon Jul 21 04:55:20 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* dir.c (dir_initialize): use rb_convert_type instead of
|
||||
|
|
5
io.c
5
io.c
|
@ -1892,7 +1892,10 @@ prepare_getline_args(int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
|
|||
}
|
||||
else {
|
||||
rb_scan_args(argc, argv, "11", &rs, &lim);
|
||||
if (NIL_P(lim) && !NIL_P(rs) && TYPE(rs) != T_STRING) {
|
||||
if (!NIL_P(lim)) {
|
||||
StringValue(rs);
|
||||
}
|
||||
else if (!NIL_P(rs) && TYPE(rs) != T_STRING) {
|
||||
VALUE tmp = rb_check_string_type(rs);
|
||||
|
||||
if (NIL_P(tmp)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue