Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/zstream/protocol.ex
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,22 @@ defmodule Zstream.Protocol do
end
end

def end_of_central_directory(offset, size, entries_count, options) do
def end_of_central_directory(offset, size, entries_count) do
<<
# end of central dir signature
0x06054B50::little-size(32),
# number of this disk
zip64?(options, 0, 0xFFFF)::little-size(16),
0::little-size(16),
# number of the disk with the start of the central directory
zip64?(options, 0, 0xFFFF)::little-size(16),
0::little-size(16),
# total number of entries in the central directory on this disk
zip64?(options, entries_count, 0xFFFF)::little-size(16),
Enum.min([entries_count, 0xFFFF])::little-size(16),
# total number of entries in the central directory
zip64?(options, entries_count, 0xFFFF)::little-size(16),
Enum.min([entries_count, 0xFFFF])::little-size(16),
# size of the central directory
zip64?(options, size, 0xFFFFFFFF)::little-size(32),
Enum.min([size, 0xFFFFFFFF])::little-size(32),
# offset of start of central directory with respect to the starting disk number
zip64?(options, offset, 0xFFFFFFFF)::little-size(32),
Enum.min([offset, 0xFFFFFFFF])::little-size(32),
# .ZIP file comment length
byte_size(@comment)::little-size(16),
@comment
Expand Down
3 changes: 1 addition & 2 deletions lib/zstream/zip.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ defmodule Zstream.Zip do
Protocol.end_of_central_directory(
state.offset,
IO.iodata_length(central_directory_headers),
length(state.entries),
global_options
length(state.entries)
)

{[
Expand Down