ObjFW  Check-in [0966f1b371]

Overview
Comment:OFTarArchive: Fix iterating without reading
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0966f1b371db4c5ec8e720ea7c8bf6f378f4eb5851c5907ac571a03b901fdeba
User & Date: js on 2022-11-23 21:45:58
Other Links: manifest | tags
Context
2022-11-23
21:47
OFLHAArchive: Fix iterating without reading check-in: 4f76840749 user: js tags: trunk
21:45
OFTarArchive: Fix iterating without reading check-in: 0966f1b371 user: js tags: trunk
21:39
Use a URI for the localization directory check-in: 88ed5be671 user: js tags: trunk
Changes

Modified src/OFTarArchive.m from [8086f04e85] to [73f1de6b8e].

170
171
172
173
174
175
176













177
178
179
180
181
182
183
- (OFTarArchiveEntry *)nextEntry
{
	uint32_t buffer[512 / sizeof(uint32_t)];
	bool empty = true;

	if (_mode != OFTarArchiveModeRead)
		@throw [OFInvalidArgumentException exception];














	[_currentEntry release];
	_currentEntry = nil;

	[(OFTarArchiveFileReadStream *)_lastReturnedStream of_skip];
	@try {
		[_lastReturnedStream close];







>
>
>
>
>
>
>
>
>
>
>
>
>







170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
- (OFTarArchiveEntry *)nextEntry
{
	uint32_t buffer[512 / sizeof(uint32_t)];
	bool empty = true;

	if (_mode != OFTarArchiveModeRead)
		@throw [OFInvalidArgumentException exception];

	if (_currentEntry != nil && _lastReturnedStream == nil) {
		/*
		 * No read stream was created since the last call to
		 * -[nextEntry]. Create it so that we can properly skip the
		 *  data.
		 */
		void *pool = objc_autoreleasePoolPush();

		[self streamForReadingCurrentEntry];

		objc_autoreleasePoolPop(pool);
	}

	[_currentEntry release];
	_currentEntry = nil;

	[(OFTarArchiveFileReadStream *)_lastReturnedStream of_skip];
	@try {
		[_lastReturnedStream close];