Differences From Artifact [03f366c882]:
- File
src/OFZIPArchive.m
— part of check-in
[a847357585]
at
2023-07-26 19:05:36
on branch trunk
— OFZIPArchive: Handle CD spanning multiple parts
Unfortunately, I could not find a file to test this with, as this is an
extremely rare corner case that basically doesn't seem to exist with
real world files: It requires an extremely small part size for an
archive with thousands of files. (user: js, size: 28748) [annotate] [blame] [check-ins using] [more...]
To Artifact [371569395b]:
- File src/OFZIPArchive.m — part of check-in [2214e91661] at 2024-03-10 21:30:57 on branch 1.0 — OFZIPArchive: More fixes for disk number 0 vs 1 (user: js, size: 29159) [annotate] [blame] [check-ins using] [more...]
1 | 1 2 3 4 5 6 7 8 9 | - + | /* |
︙ | |||
150 151 152 153 154 155 156 | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | - + + + + + + - + + + + + - + - + - + | return field; } @implementation OFZIPArchive @synthesize delegate = _delegate, archiveComment = _archiveComment; static void |
︙ | |||
227 228 229 230 231 232 233 234 235 236 237 238 239 240 | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | + + + + | if (_mode == modeRead || _mode == modeAppend) { if (![stream isKindOfClass: [OFSeekableStream class]]) @throw [OFInvalidArgumentException exception]; [self of_readZIPInfo]; [self of_readEntries]; } else if (_mode == modeWrite) { _diskNumber = 1; _lastDiskNumber = 1; _centralDirectoryDisk = 1; } if (_mode == modeAppend) { _offset = _centralDirectoryOffset; seekOrThrowInvalidFormat(self, NULL, (OFStreamOffset)_offset, OFSeekSet); } |
︙ | |||
305 306 307 308 309 310 311 312 313 314 315 316 317 318 | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | + + + | } } while (--offset >= -65557); if (!valid) @throw [OFInvalidFormatException exception]; _diskNumber = _lastDiskNumber = [_stream readLittleEndianInt16]; if (_diskNumber == 0) _diskNumber = _lastDiskNumber = 1; _centralDirectoryDisk = [_stream readLittleEndianInt16]; _centralDirectoryEntriesInDisk = [_stream readLittleEndianInt16]; _centralDirectoryEntries = [_stream readLittleEndianInt16]; _centralDirectorySize = [_stream readLittleEndianInt32]; _centralDirectoryOffset = [_stream readLittleEndianInt32]; commentLength = [_stream readLittleEndianInt16]; |
︙ | |||
339 340 341 342 343 344 345 | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | - + + - - + + + + | /* * FIXME: Handle number of the disk containing ZIP64 end of * central directory record. */ diskNumber = [_stream readLittleEndianInt32]; offset64 = [_stream readLittleEndianInt64]; |
︙ | |||
575 576 577 578 579 580 581 582 583 584 585 586 587 588 | 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | + | entry.versionMadeBy = (entry.versionMadeBy & 0xFF00) | 45; entry.minVersionNeeded = (entry.minVersionNeeded & 0xFF00) | 45; entry.compressedSize = 0; entry.uncompressedSize = 0; entry.CRC32 = 0; entry.generalPurposeBitFlag |= (seekable ? 0 : (1u << 3)) | (1u << 11); entry.of_startDiskNumber = _diskNumber; entry.of_localFileHeaderOffset = _offset; [_stream writeLittleEndianInt32: 0x04034B50]; [_stream writeLittleEndianInt16: entry.minVersionNeeded]; [_stream writeLittleEndianInt16: entry.generalPurposeBitFlag]; [_stream writeLittleEndianInt16: entry.compressionMethod]; [_stream writeLittleEndianInt16: entry.of_lastModifiedFileTime]; |
︙ |