ObjFW  Diff

Differences From Artifact [6f9fadd6e2]:

To Artifact [19e9187eb0]:

  • File src/OFLHAArchive.m — part of check-in [744956a000] at 2018-06-04 22:47:15 on branch trunk — 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. (user: js, size: 18365) [annotate] [blame] [check-ins using]


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;
}