aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c3
-rw-r--r--file.c2
-rw-r--r--io.c4
-rw-r--r--numeric.c2
5 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a5d821ca3..4b48b075ab 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]
+
Fri May 28 11:20:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_eval): bad influence on frame node.
diff --git a/bignum.c b/bignum.c
index 31a5f58c24..510860c03c 100644
--- a/bignum.c
+++ b/bignum.c
@@ -982,10 +982,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/file.c b/file.c
index a32a76dfad..435b623e3c 100644
--- a/file.c
+++ b/file.c
@@ -3970,7 +3970,7 @@ path_check_1(path)
#ifdef S_ISVTX
&& !(st.st_mode & S_ISVTX)
#endif
- ) {
+ && !access(p0, W_OK)) {
rb_warn("Insecure world writable dir %s, mode 0%o", p0, st.st_mode);
if (p) *p = '/';
return 0;
diff --git a/io.c b/io.c
index 7f6b8f438e..52b4cfb05c 100644
--- a/io.c
+++ b/io.c
@@ -1367,10 +1367,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 4c97fbe526..763e4d2ba6 100644
--- a/numeric.c
+++ b/numeric.c
@@ -818,7 +818,7 @@ static VALUE
flo_eq(x, y)
VALUE x, y;
{
- double a, b;
+ volatile double a, b;
switch (TYPE(y)) {
case T_FIXNUM: