summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-17 23:55:17 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-17 23:55:17 +0000
commit73c8156360db536af7e64b062bda1bdd4454719d (patch)
tree201df634529e172243a1ae94c6566c11f86ccb2d /time.c
parent4d16ce7da4b142d411513048895972d682a45d0f (diff)
* time.c (time_succ): Time#succ should return a time object in the
same timezone mode to the original. [ruby-talk:260256] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/time.c b/time.c
index 21d8bbd45d..798696cb22 100644
--- a/time.c
+++ b/time.c
@@ -1337,9 +1337,14 @@ static VALUE
time_succ(VALUE time)
{
struct time_object *tobj;
+ int gmt;
GetTimeval(time, tobj);
- return rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec);
+ gmt = tobj->gmt;
+ time = rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec);
+ GetTimeval(time, tobj);
+ tobj->gmt = gmt;
+ return time;
}
/*