Differences From Artifact [7073d8b5b3]:
- File src/OFZIPArchive.m — part of check-in [2071d164bb] at 2017-08-11 18:14:14 on branch trunk — Fix warnings with 32 bit Clang (user: js, size: 21103) [annotate] [blame] [check-ins using]
To Artifact [c1fa8a1f8d]:
- File
src/OFZIPArchive.m
— part of check-in
[8ebf6ed443]
at
2017-08-13 22:34:33
on branch trunk
— OFZIPArchive(Entry): Remove ZIP64 from extra field
Treating the ZIP64 extra field as part of the entry itself makes things
a lot easier when (re)writing the central directory. (user: js, size: 21490) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
607 608 609 610 611 612 613 614 615 | @implementation OFZIPArchive_LocalFileHeader - initWithStream: (OFStream *)stream { self = [super init]; @try { uint16_t fileNameLength, extraFieldLength; of_string_encoding_t encoding; | > > | | 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | @implementation OFZIPArchive_LocalFileHeader - initWithStream: (OFStream *)stream { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); OFMutableData *extraField = nil; uint16_t fileNameLength, extraFieldLength; of_string_encoding_t encoding; size_t ZIP64Index; uint16_t ZIP64Size; if ([stream readLittleEndianInt32] != 0x04034B50) @throw [OFInvalidFormatException exception]; _minVersionNeeded = [stream readLittleEndianInt16]; _generalPurposeBitFlag = [stream readLittleEndianInt16]; |
︙ | ︙ | |||
631 632 633 634 635 636 637 | extraFieldLength = [stream readLittleEndianInt16]; encoding = (_generalPurposeBitFlag & (1 << 11) ? OF_STRING_ENCODING_UTF_8 : OF_STRING_ENCODING_CODEPAGE_437); _fileName = [[stream readStringWithLength: fileNameLength encoding: encoding] copy]; | | | > | | > > > | > > > > > > > > | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | extraFieldLength = [stream readLittleEndianInt16]; encoding = (_generalPurposeBitFlag & (1 << 11) ? OF_STRING_ENCODING_UTF_8 : OF_STRING_ENCODING_CODEPAGE_437); _fileName = [[stream readStringWithLength: fileNameLength encoding: encoding] copy]; if (extraFieldLength > 0) extraField = [[[stream readDataWithCount: extraFieldLength] mutableCopy] autorelease]; of_zip_archive_entry_extra_field_find(_extraField, OF_ZIP_ARCHIVE_ENTRY_EXTRA_FIELD_ZIP64, &ZIP64Size); if (ZIP64Index != OF_NOT_FOUND) { const uint8_t *ZIP64 = [extraField itemAtIndex: ZIP64Index]; if (_uncompressedSize == 0xFFFFFFFF) _uncompressedSize = of_zip_archive_read_field64( &ZIP64, &ZIP64Size); if (_compressedSize == 0xFFFFFFFF) _compressedSize = of_zip_archive_read_field64( &ZIP64, &ZIP64Size); if (ZIP64Size > 0) @throw [OFInvalidFormatException exception]; [extraField removeItemsInRange: of_range(ZIP64Index - 4, ZIP64Size + 4)]; } [extraField makeImmutable]; _extraField = [extraField copy]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | ︙ |