ObjFW  Diff

Differences From Artifact [66df8d1952]:

To Artifact [e0c9985c5f]:


1037
1038
1039
1040
1041
1042
1043
1044

1045
1046
1047
1048
1049
1050
1051
1052
	OFString *scheme = [URL scheme];

# ifdef OF_HAVE_FILES
	if ([scheme isEqual: @"file"]) {
		if (encoding == OF_STRING_ENCODING_AUTODETECT)
			encoding = OF_STRING_ENCODING_UTF_8;

		self = [self initWithContentsOfFile: [URL path]

					   encoding: encoding];
	} else
# endif
		@throw [OFUnsupportedProtocolException exceptionWithURL: URL];

	objc_autoreleasePoolPop(pool);

	return self;







|
>
|







1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
	OFString *scheme = [URL scheme];

# ifdef OF_HAVE_FILES
	if ([scheme isEqual: @"file"]) {
		if (encoding == OF_STRING_ENCODING_AUTODETECT)
			encoding = OF_STRING_ENCODING_UTF_8;

		self = [self
		    initWithContentsOfFile: [URL fileSystemRepresentation]
				  encoding: encoding];
	} else
# endif
		@throw [OFUnsupportedProtocolException exceptionWithURL: URL];

	objc_autoreleasePoolPop(pool);

	return self;
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
		if (OF_IS_PATH_DELIMITER(characters[i])) {
			[ret addObject: [self substringWithRange:
			    of_range(last, i - last)]];

			last = i + 1;
		}
	}

	[ret addObject: [self substringWithRange: of_range(last, i - last)]];

#ifdef OF_WINDOWS
	if ([ret count] >= 2 && [[ret objectAtIndex: 0] hasSuffix: @":"]) {
		OFString *first = [[ret objectAtIndex: 0]
		    stringByAppendingPathComponent: [ret objectAtIndex: 1]];

		[ret removeObjectAtIndex: 0];
		[ret replaceObjectAtIndex: 0
			       withObject: first];
	}
#endif

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}








<


<
<
<
<
<
<
<
<
<
<
<







2204
2205
2206
2207
2208
2209
2210

2211
2212











2213
2214
2215
2216
2217
2218
2219
		if (OF_IS_PATH_DELIMITER(characters[i])) {
			[ret addObject: [self substringWithRange:
			    of_range(last, i - last)]];

			last = i + 1;
		}
	}

	[ret addObject: [self substringWithRange: of_range(last, i - last)]];












	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}