From: Yoshiyuki Kusano Date: 1997-12-04T13:17:41+09:00 Subject: [ruby-list:5525] ruby-1.0-971125 bug 草野@構造計画です. TimeのバグとStringのバグを見つけました. パッチを流しますが,Stringの方はドキュメントの方には載ってない 使い方みたいなんですが,これでよろしいんでしょうか? > 松本さん --- time.c.orig Thu Dec 4 10:13:44 1997 +++ time.c Thu Dec 4 10:15:30 1997 @@ -445,10 +445,10 @@ double d = RFLOAT(time2)->value; unsigned int i = (unsigned int) d; - return time_new_internal(i, (int)(d - (double)i)*1e6); + return assoc_new(time_new(i, (int)((d - (double)i)*1e6)), time1); } - return time_new(CLASS_OF(time1), NUM2INT(time2), 0); + return assoc_new(time_new(NUM2INT(time2), 0), time1); } static VALUE --- string.c.orig Thu Dec 4 10:16:58 1997 +++ string.c Thu Dec 4 10:18:22 1997 @@ -682,12 +682,12 @@ return (VALUE)INT2FIX(str->ptr[idx] & 0xff); case T_REGEXP: - if (str_index(str, indx)) - return reg_last_match(0); + if (str_match(str, indx) != FALSE) + return reg_last_match(backref_get()); return Qnil; case T_STRING: - if (str_index(str, indx, 0)) return indx; + if (str_index(str, indx, 0) != -1) return indx; return Qnil; default: