diff --git a/ChangeLog b/ChangeLog index a11f11c15a..d46e3b0e34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri May 16 12:40:40 2003 Yukihiro Matsumoto + + * eval.c (block_pass): chain previous block to the pushing block. + + * time.c (time_cmp): does not compare with numbers for + interchangeability. (ruby-bugs-ja PR#458) + Thu May 15 21:55:54 2003 why the lucky stiff * lib/gram.c: fixes to one-line documents and end of stream documents. diff --git a/eval.c b/eval.c index df4bfce42a..516357aab4 100644 --- a/eval.c +++ b/eval.c @@ -6984,6 +6984,7 @@ block_pass(self, node) /* PUSH BLOCK from data */ old_block = ruby_block; _block = *data; + _block.prev = old_block; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; diff --git a/time.c b/time.c index 149f8eca8c..4b402d1c59 100644 --- a/time.c +++ b/time.c @@ -716,26 +716,21 @@ time_cmp(time1, time2) } if (tobj1->tv.tv_sec > i) return INT2FIX(1); return INT2FIX(-1); - - case T_FLOAT: - return rb_dbl_cmp((double)tobj1->tv.tv_sec + (double)tobj1->tv.tv_usec*1e-6, - RFLOAT(time2)->value); - case T_BIGNUM: - return rb_dbl_cmp((double)tobj1->tv.tv_sec + (double)tobj1->tv.tv_usec*1e-6, - rb_big2dbl(time2)); - } - - if (TYPE(time2) == T_DATA && RDATA(time2)->dfree == time_free) { - GetTimeval(time2, tobj2); - if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) { - if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0); - if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1); + case T_DATA: + if (RDATA(time2)->dfree == time_free) { + GetTimeval(time2, tobj2); + if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) { + if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0); + if (tobj1->tv.tv_usec > tobj2->tv.tv_usec) return INT2FIX(1); + return INT2FIX(-1); + } + if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1); return INT2FIX(-1); } - if (tobj1->tv.tv_sec > tobj2->tv.tv_sec) return INT2FIX(1); - return INT2FIX(-1); + break; } + return Qnil; }