ObjFW  Diff

Differences From Artifact [9d8d131cd6]:

To Artifact [23bde42f6d]:


198
199
200
201
202
203
204






205
206
207
208
209
210
211
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217







+
+
+
+
+
+







	}

	[ret addObject: [OFString stringWithCString: path_c + last
					     length: i - last]];

	[pool release];

	/*
	 * Class swizzle the array to be immutable. We declared the return type
	 * to be OFArray*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFArray class];
	return ret;
}

+ (OFString*)lastComponentOfPath: (OFString*)path
{
	const char *path_c = [path cString];
	size_t path_len = [path cStringLength];
384
385
386
387
388
389
390






391
392
393
394
395
396
397
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409







+
+
+
+
+
+








		[pool release];
	} @finally {
		FindClose(handle);
	}
#endif

	/*
	 * Class swizzle the array to be immutable. We declared the return type
	 * to be OFArray*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	files->isa = [OFArray class];
	return files;
}

+ (void)changeToDirectory: (OFString*)path
{
	if (chdir([path cString]))
		@throw [OFChangeDirectoryFailedException newWithClass: self