ObjFW  Check-in [178b39b840]

Overview
Comment:OFZIPArchive: Don't compare the GPBF

Some implementations set some bits only in either the Local File Header
or the Central Directory Entry, but not in both.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 178b39b84077ec64f3ff11e5e794a85a10264f9f448531c073a9f7f7740ac0fd
User & Date: js on 2015-04-20 20:54:50
Other Links: manifest | tags
Context
2015-04-26
08:10
Minor improvements, no functional change check-in: 57b6030b14 user: js tags: trunk
2015-04-20
20:54
OFZIPArchive: Don't compare the GPBF check-in: 178b39b840 user: js tags: trunk
20:48
Remove a few now unnecessary imports check-in: 0dbf08158c user: js tags: trunk
Changes

Modified src/OFZIPArchive.m from [5f89bfb09f] to [ec81a35432].

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
	[_extraField release];

	[super dealloc];
}

- (bool)matchesEntry: (OFZIPArchiveEntry*)entry
{
	/*
	 * Bit 11 is the Language Encoding Flag, which some implementations
	 * only set in the Central Directory Entry, but not in the Local File
	 * Header. Therefore, ignore it for the comparison of the General
	 * Purpose Bit Flag.
	 */
	uint16_t generalPurposeBitFlag = _generalPurposeBitFlag & ~(1 << 11);
	uint16_t entryGeneralPurposeBitFlag =
	    [entry OF_generalPurposeBitFlag] & ~(1 << 11);

	if (_minVersionNeeded != [entry minVersionNeeded] ||
	    generalPurposeBitFlag != entryGeneralPurposeBitFlag ||
	    _compressionMethod != [entry compressionMethod] ||
	    _lastModifiedFileTime != [entry OF_lastModifiedFileTime] ||
	    _lastModifiedFileDate != [entry OF_lastModifiedFileDate])
		return false;

	if (!(_generalPurposeBitFlag & (1 << 3)))
		if (_CRC32 != [entry CRC32] ||







<
<
<
<
<
<
<
<
<
<

<







422
423
424
425
426
427
428










429

430
431
432
433
434
435
436
	[_extraField release];

	[super dealloc];
}

- (bool)matchesEntry: (OFZIPArchiveEntry*)entry
{










	if (_minVersionNeeded != [entry minVersionNeeded] ||

	    _compressionMethod != [entry compressionMethod] ||
	    _lastModifiedFileTime != [entry OF_lastModifiedFileTime] ||
	    _lastModifiedFileDate != [entry OF_lastModifiedFileDate])
		return false;

	if (!(_generalPurposeBitFlag & (1 << 3)))
		if (_CRC32 != [entry CRC32] ||