From 4f127ee34b7eabf7c5816e973448ea5fe11c3310 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 4 Jun 2004 09:56:25 +0000 Subject: [PATCH] * 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/trunk@6427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ bignum.c | 3 ++- file.c | 2 +- io.c | 4 +--- numeric.c | 2 +- 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 + + * 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 * 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: