ObjFW  Diff

Differences From Artifact [ce308c71b7]:

To Artifact [bad1c6eacd]:


169
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

	@try {
		void *pool;
		OFMutableDictionary *environment;
#if defined(__MACH__) && !defined(OF_IOS)
		char **env = *_NSGetEnviron();
#elif defined(__WIN32)
		of_char16_t *env;
#elif !defined(OF_IOS)
		char **env = environ;
#else
		char *env;
#endif

		environment = [[OFMutableDictionary alloc] init];

		atexit(atexitHandler);
#if defined(_WIN32)
		env = GetEnvironmentStringsW();

		while (*env != 0) {
			OFString *tmp, *key, *value;
			size_t length, pos;

			pool = objc_autoreleasePoolPush();








|










|







169
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

	@try {
		void *pool;
		OFMutableDictionary *environment;
#if defined(__MACH__) && !defined(OF_IOS)
		char **env = *_NSGetEnviron();
#elif defined(__WIN32)
		of_char16_t *env, *env0;
#elif !defined(OF_IOS)
		char **env = environ;
#else
		char *env;
#endif

		environment = [[OFMutableDictionary alloc] init];

		atexit(atexitHandler);
#if defined(_WIN32)
		env = env0 = GetEnvironmentStringsW();

		while (*env != 0) {
			OFString *tmp, *key, *value;
			size_t length, pos;

			pool = objc_autoreleasePoolPush();

220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

			[environment setObject: value
					forKey: key];

			objc_autoreleasePoolPop(pool);
		}

		FreeEnvironmentStringsW(env);
#elif !defined(OF_IOS)
		if (env != NULL) {
			for (; *env != NULL; env++) {
				OFString *key, *value;
				char *sep;
				const of_string_encoding_t encoding =
				    [OFString nativeOSEncoding];







|







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

			[environment setObject: value
					forKey: key];

			objc_autoreleasePoolPop(pool);
		}

		FreeEnvironmentStringsW(env0);
#elif !defined(OF_IOS)
		if (env != NULL) {
			for (; *env != NULL; env++) {
				OFString *key, *value;
				char *sep;
				const of_string_encoding_t encoding =
				    [OFString nativeOSEncoding];