ObjFW  Diff

Differences From Artifact [cd0c9b6190]:

To Artifact [06ca9c602c]:


31
32
33
34
35
36
37

38
39
40
41
42
43
44
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45







+







#import "OFString.h"
#import "OFSystemInfo.h"
#import "OFURL.h"
#import "OFURLHandler.h"

#import "OFChangeCurrentDirectoryPathFailedException.h"
#import "OFCopyItemFailedException.h"
#import "OFGetCurrentDirectoryPathFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFMoveItemFailedException.h"
#import "OFOutOfMemoryException.h"
#import "OFOutOfRangeException.h"
#import "OFRemoveItemFailedException.h"
#import "OFRetrieveItemAttributesFailedException.h"
#import "OFUndefinedKeyException.h"
155
156
157
158
159
160
161
162
163

164

165
166
167
168





169
170
171
172
173
174
175
176
177
178
179
180
156
157
158
159
160
161
162


163
164
165




166
167
168
169
170





171
172
173
174
175
176
177







-
-
+

+
-
-
-
-
+
+
+
+
+
-
-
-
-
-








		return nil;
	}

	return [OFString stringWithCString: buffer
				  encoding: [OFLocalization encoding]];
#else
	OFString *ret;
	char *buffer = getcwd(NULL, 0);
	char buffer[PATH_MAX];

	if ((getcwd(buffer, PATH_MAX)) == NULL)
	@try {
		ret = [OFString
		    stringWithCString: buffer
			     encoding: [OFLocalization encoding]];
		@throw [OFGetCurrentDirectoryPathFailedException
		    exceptionWithErrNo: errno];

	return [OFString stringWithCString: buffer
				  encoding: [OFLocalization encoding]];
	} @finally {
		free(buffer);
	}

	return ret;
#endif
}

- (OFURL *)currentDirectoryURL
{
	OFMutableURL *URL = [OFMutableURL URL];
	void *pool = objc_autoreleasePoolPush();