From 24fbba4288af08e0a35b51d8982f168740b3c652 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 3 Oct 2003 09:05:55 +0000 Subject: [PATCH] Thanks to Clifford Heath for noticing that Time.to_binary_dos_date and time were reversed --- zip/stdrubyext.rb | 4 ++-- zip/zip.rb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zip/stdrubyext.rb b/zip/stdrubyext.rb index 79ff021..c950066 100755 --- a/zip/stdrubyext.rb +++ b/zip/stdrubyext.rb @@ -66,13 +66,13 @@ class Time # bits 9-15 year (four digit year minus 1980) - def to_binary_dos_date + def to_binary_dos_time (sec/2) + (min << 5) + (hour << 11) end - def to_binary_dos_time + def to_binary_dos_date (day) + (month << 5) + ((year - 1980) << 9) diff --git a/zip/zip.rb b/zip/zip.rb index 1dc750e..c02d10e 100755 --- a/zip/zip.rb +++ b/zip/zip.rb @@ -426,8 +426,8 @@ module Zip 0 , # @version , 0 , # @gpFlags , @compression_method , - @time.to_binary_dos_date , # @lastModTime , - @time.to_binary_dos_time , # @lastModDate , + @time.to_binary_dos_time , # @lastModTime , + @time.to_binary_dos_date , # @lastModDate , @crc , @compressed_size , @size , @@ -496,8 +496,8 @@ module Zip 0 , # @versionNeededToExtract , 0 , # @gpFlags , @compression_method , - @time.to_binary_dos_date , # @lastModTime , - @time.to_binary_dos_time , # @lastModDate , + @time.to_binary_dos_time , # @lastModTime , + @time.to_binary_dos_date , # @lastModDate , @crc , @compressed_size , @size ,