summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c3
-rw-r--r--io.c4
-rw-r--r--numeric.c2
4 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b18521373..b191d3b7ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/bignum.c b/bignum.c
index 92384bf8e3..35b79d8877 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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:
diff --git a/io.c b/io.c
index 363e839cb7..54c3dee767 100644
--- a/io.c
+++ b/io.c
@@ -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;
}
diff --git a/numeric.c b/numeric.c
index 92a435df15..900054f83e 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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: