ObjFW  Check-in [f31715929b]

Overview
Comment:OFZIPArchive: Only write after successful init
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f31715929b20fb22682afb6ec908ea994cc3f6ca41d6589bcc3035d1242b50aa
User & Date: js on 2017-08-07 22:55:55
Other Links: manifest | tags
Context
2017-08-11
15:47
of_asprintf: Don't require set up OFLocalization check-in: 17098e76eb user: js tags: trunk
2017-08-07
22:55
OFZIPArchive: Only write after successful init check-in: f31715929b user: js tags: trunk
22:46
ofzip: Fix typo in lang/de.json check-in: a0a08492f7 user: js tags: trunk
Changes

Modified src/OFZIPArchive.m from [c368c2a33f] to [eca8fcf711].

203
204
205
206
207
208
209








210
211
212
213
214
215
216

		if (_mode == OF_ZIP_ARCHIVE_MODE_APPEND) {
			_offset = _centralDirectoryOffset;
			seekOrThrowInvalidFormat(_stream,
			    (of_offset_t)_offset, SEEK_SET);
		}
	} @catch (id e) {








		[self release];
		@throw e;
	}

	return self;
}








>
>
>
>
>
>
>
>







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224

		if (_mode == OF_ZIP_ARCHIVE_MODE_APPEND) {
			_offset = _centralDirectoryOffset;
			seekOrThrowInvalidFormat(_stream,
			    (of_offset_t)_offset, SEEK_SET);
		}
	} @catch (id e) {
		/*
		 * If we are in write or append mode, we do not want -[close]
		 * to write anything to it on error - after all, it might not
		 * be a ZIP file which we would destroy otherwise.
		 */
		[_stream release];
		_stream = nil;

		[self release];
		@throw e;
	}

	return self;
}