1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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@19742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-10-10 02:34:02 +00:00
parent 29be7a1536
commit 1584d7a7f1
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Oct 10 11:34:00 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* time.c (time_mdump, time_mload): preserves GMT status.
[ruby-core:19252]
Fri Oct 10 00:21:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (ParseError.filter_backtrace): removes internal

7
time.c
View file

@ -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;