diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bignum.c | 3 | ||||
-rw-r--r-- | io.c | 4 | ||||
-rw-r--r-- | numeric.c | 2 |
4 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Jun 2 12:41:53 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * io.c (rb_io_gets_m): set lastline ($_) even when read line is + nil. [ruby-dev:23663] + Thu May 27 23:15:18 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> * lib/logger.rb: leading 0 padding of timestamp usec part. @@ -966,10 +966,11 @@ rb_big_eq(x, y) break; case T_FLOAT: { - double a, b; + volatile double a, b; a = RFLOAT(y)->value; b = rb_big2dbl(x); + if (isnan(a) || isnan(b)) return Qfalse; return (a == b)?Qtrue:Qfalse; } default: @@ -1347,10 +1347,8 @@ rb_io_gets_m(argc, argv, io) } GetOpenFile(io, fptr); str = rb_io_getline(rs, fptr); + rb_lastline_set(str); - if (!NIL_P(str)) { - rb_lastline_set(str); - } return str; } @@ -817,7 +817,7 @@ static VALUE flo_eq(x, y) VALUE x, y; { - double a, b; + volatile double a, b; switch (TYPE(y)) { case T_FIXNUM: |