summaryrefslogtreecommitdiffstats
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
commit59b946f574ec11e3d60aa0ab4f94dbc8c33578f8 (patch)
tree201df634529e172243a1ae94c6566c11f86ccb2d /time.c
parent2a0d84d80b38b5915384d87145fbf7018254239a (diff)
downloadruby-59b946f574ec11e3d60aa0ab4f94dbc8c33578f8.tar.gz
ruby-59b946f574ec11e3d60aa0ab4f94dbc8c33578f8.tar.xz
ruby-59b946f574ec11e3d60aa0ab4f94dbc8c33578f8.zip
* 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: http://svn.ruby-lang.org/repos/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 21d8bbd45..798696cb2 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;
}
/*