diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 11:04:23 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 11:04:23 +0000 |
commit | 8d6d95d3a1717af15665d0e0ee7578ed2d615268 (patch) | |
tree | 113b926b3a28ee77f9bcb16dbfbcdaaa1239d9e4 /time.c | |
parent | c34256906e27f8381649423efa1ffa4c7d372428 (diff) |
merge revision(s) 19742:
* time.c (time_mdump, time_mload): preserves GMT status.
[ruby-core:19252]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1931,6 +1931,7 @@ time_mdump(time) rb_raise(rb_eArgError, "year too big to marshal"); p = 0x1UL << 31 | /* 1 */ + tobj->gmt << 30 | /* 1 */ tm->tm_year << 14 | /* 16 */ tm->tm_mon << 10 | /* 4 */ tm->tm_mday << 5 | /* 5 */ @@ -1989,7 +1990,7 @@ time_mload(time, str) time_t sec, usec; unsigned char *buf; struct tm tm; - int i; + int i, gmt; time_modify(time); StringValue(str); @@ -2011,7 +2012,8 @@ time_mload(time, str) usec = s; } else { - p &= ~(1UL<<31); + p &= ~(1UL<<31); + gmt = (p >> 30) & 0x1; tm.tm_year = (p >> 14) & 0xffff; tm.tm_mon = (p >> 10) & 0xf; tm.tm_mday = (p >> 5) & 0x1f; @@ -2027,6 +2029,7 @@ time_mload(time, str) GetTimeval(time, tobj); tobj->tm_got = 0; + tobj->gmt = gmt; tobj->tv.tv_sec = sec; tobj->tv.tv_usec = usec; return time; |