summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_time.rb7
-rw-r--r--time.c5
-rw-r--r--version.h2
4 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bee385831..d63c994bcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jan 13 15:22:43 2012 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]
+
Thu Jan 12 13:52:13 2012 NARUSE, Yui <naruse@ruby-lang.org>
* cont.c (cont_restore_0): prevent optimizing out `sp'. sp is used for
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 0e61f32ab0..a1f060ec85 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -277,6 +277,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
diff --git a/time.c b/time.c
index 5122466675..755812f00e 100644
--- a/time.c
+++ b/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) \
diff --git a/version.h b/version.h
index a98abb61a1..fc6798f996 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 26
+#define RUBY_PATCHLEVEL 27
#define RUBY_RELEASE_DATE "2012-01-13"
#define RUBY_RELEASE_YEAR 2012