ObjFW  Check-in [86b1caa4d2]

Overview
Comment:Fix DJGPP's getcwd() returning forward slashes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 86b1caa4d2fce0f478e1648d577d2325c2cd767904be6fa3e8a6f39569ac283c
User & Date: js on 2018-02-11 15:12:58
Other Links: manifest | tags
Context
2018-02-11
15:17
Update buildsys check-in: 7482940215 user: js tags: trunk
15:12
Fix DJGPP's getcwd() returning forward slashes check-in: 86b1caa4d2 user: js tags: trunk
14:55
OFInvocationTests: Check for complex.h check-in: 90a96b9682 user: js tags: trunk
Changes

Modified src/OFFileManager.m from [06ca9c602c] to [85bf245254].

161
162
163
164
165
166
167










168
169
170
171
172
173
174
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184







+
+
+
+
+
+
+
+
+
+







				  encoding: [OFLocalization encoding]];
#else
	char buffer[PATH_MAX];

	if ((getcwd(buffer, PATH_MAX)) == NULL)
		@throw [OFGetCurrentDirectoryPathFailedException
		    exceptionWithErrNo: errno];

# ifdef OF_DJGPP
	/*
	 * For some reason, getcwd() returns forward slashes on DJGPP, even
	 * though the native format is to use backwards slashes.
	 */
	for (char *tmp = buffer; *tmp != '\0'; tmp++)
		if (*tmp == '/')
			*tmp = '\\';
# endif

	return [OFString stringWithCString: buffer
				  encoding: [OFLocalization encoding]];
#endif
}

- (OFURL *)currentDirectoryURL