ObjFW  Check-in [8e4451aee2]

Overview
Comment:OFDeflateStream: Fix -[isAtEndOfStream]

Returning true if _decompression is NULL is a bad idea, as it means
-[isAtEndOfStream] will return true when no read has happened yet. This
breaks the common case where -[isAtEndOfStream] is checked in the loop
condition and the read only happens in the loop body.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8e4451aee2c0cbc4584220a7a63cdd9bd90ed3ad4fa45d5ecb8ca639f3be94a3
User & Date: js on 2016-05-29 19:43:34
Other Links: manifest | tags
Context
2016-05-29
19:59
Add support for ustar check-in: 264126064b user: js tags: trunk
19:43
OFDeflateStream: Fix -[isAtEndOfStream] check-in: 8e4451aee2 user: js tags: trunk
18:47
Use <sys/ttycom.h> instead of <sys/termio.h> check-in: 2e872e742c user: js tags: trunk
Changes

Modified src/OFDeflateStream.m from [6767b2487a] to [c4f1ea9fcd].

820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
	OF_UNREACHABLE
}

#ifndef DEFLATE64
- (bool)lowlevelIsAtEndOfStream
{
	if (_decompression == NULL)
		return true;

	return _decompression->atEndOfStream;
}

- (int)fileDescriptorForReading
{
	return [_stream fileDescriptorForReading];







|







820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
	OF_UNREACHABLE
}

#ifndef DEFLATE64
- (bool)lowlevelIsAtEndOfStream
{
	if (_decompression == NULL)
		return false;

	return _decompression->atEndOfStream;
}

- (int)fileDescriptorForReading
{
	return [_stream fileDescriptorForReading];