diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bignum.c | 3 | ||||
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | io.c | 4 | ||||
-rw-r--r-- | numeric.c | 2 |
5 files changed, 10 insertions, 6 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] + Fri May 28 11:20:31 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (rb_eval): bad influence on frame node. @@ -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: @@ -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; @@ -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; } @@ -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: |