Project

General

Profile

Bug #6193 » ruby-time-sec-str2.patch

ssuda (Sambasiva Suda), 03/24/2012 06:48 AM

View differences:

time.c (working copy)
vtm.min = NIL_P(v[4]) ? 0 : obj2int(v[4]);
vtm.sec = 0;
vtm.subsecx = INT2FIX(0);
if (!NIL_P(v[5])) {
VALUE sec = num_exact(v[5]);
VALUE subsec;
divmodv(sec, INT2FIX(1), &sec, &subsec);
vtm.sec = NUM2INT(sec);
vtm.subsecx = w2v(rb_time_magnify(v2w(subsec)));
}
vtm.sec = NIL_P(v[5]) ? 0 : obj2subsecx(v[5], &vtm.subsecx);
vtm.isdst = -1;
vtm.utc_offset = Qnil;
ChangeLog (working copy)
Fri Mar 24 06:47:00 2012 Sambasiva Rao Suda <sambasivarao@gmail.org>
* time.c (time_init_1): Time.new will accept seconds as string or int.
[ruby-core:43569] [Bug #6193]
Fri Mar 23 15:12:12 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
* transcode.c (documentation for str_encode): Explain
test/test_time.rb (working copy)
bug4456 = '[ruby-dev:43284]'
assert_normal_exit %q{ Time.now.strftime("%1000000000F") }, bug4456
end
def test_sec_str
bug6193 = '[ruby-core:43569]'
assert_normal_exit %q{ Time.new(2012, 1, 2, 3, 4, "5") }, bug6193
assert_equal(Time.new(2012, 1, 2, 3, 4, 5), Time.new(2012, 1, 2, 3, 4, "5"))
end
end
(2-2/2)