Fix #119 calling 'path' on not IO objects

This commit is contained in:
Alexander Simonov 2014-01-06 20:29:08 +02:00
parent 04e0759e09
commit 18506c6345
1 changed files with 6 additions and 1 deletions

View File

@ -177,7 +177,12 @@ module Zip
end end
def read_c_dir_entry(io) #:nodoc:all def read_c_dir_entry(io) #:nodoc:all
entry = new(io.path) path = if io.is_a?(::IO)
io.path
else
''
end
entry = new(path)
entry.read_c_dir_entry(io) entry.read_c_dir_entry(io)
entry entry
rescue ZipError rescue ZipError