diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 11:03:25 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-02 11:03:25 +0000 |
commit | e50a1dc13d0e4e2c41dfe67327463964c3122621 (patch) | |
tree | 51e18f3a80bd3952292eddd151acf36193b23bc3 /time.c | |
parent | 1201b970eeff276d516bf608d9de90f9610b0983 (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_6@21969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1928,6 +1928,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 */ @@ -1986,7 +1987,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); @@ -2008,7 +2009,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; @@ -2024,6 +2026,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; |