mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
* io.c (rb_f_backquote): need not to check nil result.
[ruby-core:02078] * io.c (rb_io_getline): should return nil on eof, even when nil rs is specified. [ruby-core:02077] * pack.c (pack_pack): add sign check for 'i', and 'l'. [ruby-dev:22427] * bignum.c (rb_quad_pack): add range check for 'quad int'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ab0c37d0cf
commit
b9a79bc020
6 changed files with 41 additions and 20 deletions
3
io.c
3
io.c
|
@ -1027,6 +1027,7 @@ rb_io_getline(rs, fptr)
|
|||
|
||||
rb_io_check_readable(fptr);
|
||||
if (NIL_P(rs)) {
|
||||
if (feof(fptr->f)) return Qnil;
|
||||
str = read_all(fptr, 0, Qnil);
|
||||
}
|
||||
else if (rs == rb_default_rs) {
|
||||
|
@ -3223,10 +3224,8 @@ rb_f_backquote(obj, str)
|
|||
|
||||
GetOpenFile(port, fptr);
|
||||
result = read_all(fptr, remain_size(fptr), Qnil);
|
||||
|
||||
rb_io_close(port);
|
||||
|
||||
if (NIL_P(result)) return rb_str_new(0,0);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue