From 275b38937e8d89a625351be13d66b4fcb82333db Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 28 Sep 2015 08:43:44 +0000 Subject: * lib/net/ftp.rb (mtime): use usec instead of fractions to parse decimal fractions of a second correctly when the number of digits is not 6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/ftp.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 795e1cbdc3..9ce161b7e7 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -895,8 +895,7 @@ module Net raise FTPProtoError, "invalid time-val: #{value}" end usec = fractions.to_i * 10 ** (6 - fractions.to_s.size) - Time.send(local ? :local : :utc, - year, month, day, hour, min, sec, fractions) + Time.send(local ? :local : :utc, year, month, day, hour, min, sec, usec) } FACT_PARSERS = Hash.new(CASE_DEPENDENT_PARSER) FACT_PARSERS["size"] = DECIMAL_PARSER -- cgit v1.2.3