summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-22 12:08:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-22 12:08:02 +0000
commit1d674dc54730b7ffe900146139cbac13fe967f50 (patch)
treec2a65a8468fe4bb26c16f148ec405061a83aa65f /time.c
parent0f02abb31bcb2da501845b945eea191a5bdadb4d (diff)
* time.c (time_mload): add submicro into vtm.subsecx. [ruby-dev:40133]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/time.c b/time.c
index 2d5edbe338..6b0685d591 100644
--- a/time.c
+++ b/time.c
@@ -3780,6 +3780,7 @@ time_mload(VALUE time, VALUE str)
int digit;
ptr = (unsigned char*)StringValuePtr(submicro);
len = RSTRING_LEN(submicro);
+ nsec = 0;
if (0 < len) {
if (10 <= (digit = ptr[0] >> 4)) goto end_submicro;
nsec += digit * 100;
@@ -3790,6 +3791,7 @@ time_mload(VALUE time, VALUE str)
if (10 <= (digit = ptr[1] >> 4)) goto end_submicro;
nsec += digit;
}
+ vtm.subsecx = add(vtm.subsecx, mulquo(LONG2FIX(nsec), INT2FIX(TIME_SCALE), LONG2FIX(1000000000)));
end_submicro: ;
}
timexv = timegmxv(&vtm);