Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't react to strongly on incorrect encoding of external file attrib…

…utes.
  • Loading branch information...
commit 3bf664c07fa01cb1a41fe9e8f3ac54a48e479590 1 parent a4dc121
thomas authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/zip/zip.rb
View
8 lib/zip/zip.rb
@@ -643,7 +643,7 @@ def read_c_dir_entry(io) #:nodoc:all
when 012
@ftype = :symlink
else
- raise ZipInternalError, "unknown file type #{'0%o' % (@externalFileAttributes >> 28)}"
+ @ftype = :unknown
end
else
if name_is_directory?
@@ -709,11 +709,11 @@ def write_c_dir_entry(io) #:nodoc:all
when :symlink
ft = 012
@unix_perms ||= 0755
- else
- raise ZipInternalError, "unknown file type #{self.inspect}"
end
- @externalFileAttributes = (ft << 12 | (@unix_perms & 07777)) << 16
+ if (!ft.nil?)
+ @externalFileAttributes = (ft << 12 | (@unix_perms & 07777)) << 16
+ end
end
io <<
Please sign in to comment.
Something went wrong with that request. Please try again.