Fix for FreeBSD 4.9

This commit is contained in:
thomas 2004-04-02 05:25:53 +00:00
parent 0c3d4f81f9
commit 0dba89f427
2 changed files with 7 additions and 0 deletions

5
NEWS
View File

@ -1,3 +1,8 @@
= Version 0.5.6 =
Fix for FreeBSD 4.9 which returns Errno::EFBIG instead of
Errno::EINVAL for some invalid seeks.
= Version 0.5.5 =
Fix for a problem with writing zip files that concerns only ruby 1.8.1.

View File

@ -814,6 +814,8 @@ module Zip
io.seek(-MAX_END_OF_CENTRAL_DIRECTORY_STRUCTURE_SIZE, IO::SEEK_END)
rescue Errno::EINVAL
io.seek(0, IO::SEEK_SET)
rescue Errno::EFBIG # FreeBSD 4.9 returns Errno::EFBIG instead of Errno::EINVAL
io.seek(0, IO::SEEK_SET)
end
buf = io.read
sigIndex = buf.rindex([END_OF_CENTRAL_DIRECTORY_SIGNATURE].pack('V'))