зеркало из https://github.com/github/ruby.git
* time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.
patch by Tomoyuki Chikanaga. [ruby-dev:44827] [Bug #5586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b0fe688676
Коммит
6445aab472
|
@ -1,3 +1,9 @@
|
|||
Sat Nov 19 19:31:47 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* time.c (TIME_COPY_GMT): copy vtm.utc_offset and vtm.zone too.
|
||||
patch by Tomoyuki Chikanaga.
|
||||
[ruby-dev:44827] [Bug #5586]
|
||||
|
||||
Sat Nov 19 16:36:57 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/net/http/test_http.rb: remove temporally files in ensure clause.
|
||||
|
|
|
@ -278,6 +278,13 @@ class TestTime < Test::Unit::TestCase
|
|||
assert_equal(29700, t2.utc_offset, bug)
|
||||
end
|
||||
|
||||
def test_marshal_to_s
|
||||
t1 = Time.new(2011,11,8, 0,42,25, 9*3600)
|
||||
t2 = Time.at(Marshal.load(Marshal.dump(t1)))
|
||||
assert_equal("2011-11-08 00:42:25 +0900", t2.to_s,
|
||||
"[ruby-dev:44827] [Bug #5586]")
|
||||
end
|
||||
|
||||
# Sat Jan 01 00:00:00 UTC 2000
|
||||
T2000 = Time.at(946684800).gmtime
|
||||
|
||||
|
|
5
time.c
5
time.c
|
@ -1820,7 +1820,10 @@ struct time_object {
|
|||
(tobj)->vtm.utc_offset = (off), \
|
||||
(tobj)->vtm.zone = NULL)
|
||||
|
||||
#define TIME_COPY_GMT(tobj1, tobj2) ((tobj1)->gmt = (tobj2)->gmt)
|
||||
#define TIME_COPY_GMT(tobj1, tobj2) \
|
||||
((tobj1)->gmt = (tobj2)->gmt, \
|
||||
(tobj1)->vtm.utc_offset = (tobj2)->vtm.utc_offset, \
|
||||
(tobj1)->vtm.zone = (tobj2)->vtm.zone)
|
||||
|
||||
static VALUE time_get_tm(VALUE, struct time_object *);
|
||||
#define MAKE_TM(time, tobj) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче