summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-04 09:56:25 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-04 09:56:25 +0000
commit79c70445820ff72bfa1e2f4b0d4c1cc73e5fb510 (patch)
treeefc33dbe637bec20505d88c484551fe7a8445496
parent1c9d6dd646d508a3b4de0e84424283242708fe77 (diff)
* io.c (rb_io_gets_m): set lastline ($_) even when read line is
nil. [ruby-dev:23663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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 4b18521..b191d3b 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 92384bf..35b79d8 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 363e839..54c3dee 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 92a435d..900054f 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: