Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zip
: find preambles for zip files written by archive/zip
zip files written by `archive/zip`'s `Writer` correctly report the byte offsets of their central directory file header and end of central directory entries, but this means the offset of the zip data within the file as calculated by `archive/zip`'s `Reader` will always be 0 - in other words, `Reader` thinks that any non-zip data prepended to the file is actually part of the first file's local file header. This prevents any zip file written by `archive/zip` from being used as a source for the `zip` command's `--preamble_from` option, because the non-zip data doesn't appear to be non-zip data at all. In cases where `Reader` identifies that the byte offset of the zip data within the file is 0, check whether the byte offset of the header for the first local file header is also 0. If it isn't, assume the byte offset of the first local file header is the true starting position of the zip data within the file, and that anything before it is in fact a preamble.
- Loading branch information