Support robolectric zip expectations (similar to command line zip)
Test: mma in /external/robolectric Bug: 244627502 Change-Id: Id6b2b0bdb7b666a1e598b5451f869bf3d56953e5
This commit is contained in:
parent
f32579b08a
commit
e0c45acc6b
1 changed files with 10 additions and 2 deletions
10
third_party/zip/writer.go
vendored
10
third_party/zip/writer.go
vendored
|
@ -162,10 +162,18 @@ func (w *Writer) Close() error {
|
|||
if records > uint16max {
|
||||
records = uint16max
|
||||
}
|
||||
// END ANDROID CHANGE
|
||||
// Only store uint32max for the size and the offset if they don't fit.
|
||||
// Robolectric currently doesn't support zip64 and fails to find the
|
||||
// offset to the central directory when the number of files in the zip
|
||||
// is larger than 2^16.
|
||||
if size > uint32max {
|
||||
size = uint32max
|
||||
}
|
||||
if offset > uint32max {
|
||||
offset = uint32max
|
||||
}
|
||||
// END ANDROID CHANGE
|
||||
}
|
||||
|
||||
// write end record
|
||||
var buf [directoryEndLen]byte
|
||||
|
|
Loading…
Reference in a new issue