ObjFW  Check-in [744956a000]

Overview
Comment:OFLHAArchive: Prefill the sliding window with ' '

Apparently, there are two incompatible variants of LHA: One where the
sliding window is prefilled with zeros and one where it is prefilled
with spaces. It seems prefilling it with spaces is the original way,
while LHA on Amiga prefilled it with zeros.

As it is impossible to detect which one was used, a flag will be added
later to provide an Amiga compatibility mode.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 744956a000a632556267f5c3d2b92e55f8498b9f14459140b17bdddf12c4dca6
User & Date: js on 2018-06-04 22:47:15
Other Links: manifest | tags
Context
2018-06-06
21:36
.travis.yml: Disable devkitPro-based builds check-in: 1d154b247f user: js tags: trunk
2018-06-04
22:47
OFLHAArchive: Prefill the sliding window with ' ' check-in: 744956a000 user: js tags: trunk
22:05
OFLHAArchive: Verify CRC16 checksum check-in: fca5e53e12 user: js tags: trunk
Changes

Modified src/OFLHAArchive.m from [6f9fadd6e2] to [19e9187eb0].

295
296
297
298
299
300
301
302
303

304
305
306
307
308
309
310
		/* 0-7 address the bit, 8 means fetch next byte */
		_bitIndex = 8;

		_distanceBits = distanceBits;
		_dictionaryBits = dictionaryBits;

		_slidingWindowMask = (1 << dictionaryBits) - 1;
		_slidingWindow = [self allocZeroedMemoryWithSize:
		    _slidingWindowMask + 1];

	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}







|

>







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
		/* 0-7 address the bit, 8 means fetch next byte */
		_bitIndex = 8;

		_distanceBits = distanceBits;
		_dictionaryBits = dictionaryBits;

		_slidingWindowMask = (1 << dictionaryBits) - 1;
		_slidingWindow = [self allocMemoryWithSize:
		    _slidingWindowMask + 1];
		memset(_slidingWindow, ' ', _slidingWindowMask + 1);
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}