ObjFW  Check-in [1ce5d53f93]

Overview
Comment:OFZIPArchive: Only check lower byte of minVersion.

The higher byte identifies the OS and is not helpful in the comparison,
as it's better to just try to decompress it instead of checking if we
are on the specified OS.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1ce5d53f93bdfd656199fe8c5bdec8c2c93b25415d9a58e4d39da7c39658a834
User & Date: js on 2013-10-29 18:00:08
Other Links: manifest | tags
Context
2013-10-29
22:15
OFDeflateStream: Fix tree construction. check-in: aee3bc12f7 user: js tags: trunk
18:00
OFZIPArchive: Only check lower byte of minVersion. check-in: 1ce5d53f93 user: js tags: trunk
10:09
OFDeflateStream: Minor improvements. check-in: f91dbd8975 user: js tags: trunk
Changes

Modified src/OFZIPArchive.m from [8bbe969b1a] to [b1f97cb82f].

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
		     whence: SEEK_SET];
	localFileHeader = [[[OFZIPArchive_LocalFileHeader alloc]
	    initWithFile: _file] autorelease];

	if (![localFileHeader matchesEntry: entry])
		@throw [OFInvalidFormatException exception];

	if (localFileHeader->_minVersion > 20) {
		OFString *version = [OFString stringWithFormat: @"%u.%u",
		    localFileHeader->_minVersion / 10,
		    localFileHeader->_minVersion % 10];

		@throw [OFUnsupportedVersionException
		    exceptionWithVersion: version];
	}

	ret = [[OFZIPArchive_FileStream alloc]
	    initWithArchiveFile: _path







|

|
|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
		     whence: SEEK_SET];
	localFileHeader = [[[OFZIPArchive_LocalFileHeader alloc]
	    initWithFile: _file] autorelease];

	if (![localFileHeader matchesEntry: entry])
		@throw [OFInvalidFormatException exception];

	if ((localFileHeader->_minVersion & 0xFF) > 20) {
		OFString *version = [OFString stringWithFormat: @"%u.%u",
		    (localFileHeader->_minVersion & 0xFF) / 10,
		    (localFileHeader->_minVersion & 0xFF) % 10];

		@throw [OFUnsupportedVersionException
		    exceptionWithVersion: version];
	}

	ret = [[OFZIPArchive_FileStream alloc]
	    initWithArchiveFile: _path