summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 01:28:12 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-22 01:28:12 +0000
commitf25a57b3ef00ac4aff728615aca6764e89163099 (patch)
tree7178ab7fd8d7db568b136938f078539dc983c662 /time.c
parentd1992916e05993b671e9ee9a92e0bb325aadf27a (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/branches/ruby_1_8_6@13184 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 f1719b6..c749020 100644
--- a/time.c
+++ b/time.c
@@ -1397,9 +1397,14 @@ time_succ(time)
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;
}
/*