ObjFW  Diff

Differences From Artifact [a34547048c]:

To Artifact [7aef38f501]:


1136
1137
1138
1139
1140
1141
1142
1143

1144
1145

1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173

1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187

1188
1189

1190
1191
1192
1193
1194
1195
1196

1197
1198
1199
1200
1201
1202

1203
1204
1205
1206


1207
1208

1209
1210
1211
1212
1213
1214
1215
1136
1137
1138
1139
1140
1141
1142

1143
1144

1145


1146

























1147














1148
1149

1150
1151
1152
1153
1154
1155


1156


1157



1158




1159
1160
1161

1162
1163
1164
1165
1166
1167
1168
1169







-
+

-
+
-
-

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

-
+





-
-
+
-
-

-
-
-
+
-
-
-
-
+
+

-
+








	objc_autoreleasePoolPop(pool);

	return [path autorelease];
}
#endif

- (OFMutableURL *)of_URLByAppendingPathComponent: (OFString *)component
- (OFURL *)URLByAppendingPathComponent: (OFString *)component
{
	OFMutableURL *ret = [[self mutableCopy] autorelease];
	OFMutableURL *URL = [[self mutableCopy] autorelease];
	void *pool;
	OFMutableString *URLEncodedPath;

	if ([component hasPrefix: @"/"]) {
		ret.path = component;
		return ret;
	}

	pool = objc_autoreleasePoolPush();
	URLEncodedPath = [[self.URLEncodedPath mutableCopy] autorelease];

	if (![URLEncodedPath hasSuffix: @"/"])
		[URLEncodedPath appendString: @"/"];

	[URLEncodedPath appendString:
	    [component stringByURLEncodingWithAllowedCharacters:
	    [OFCharacterSet URLPathAllowedCharacterSet]]];

	ret.URLEncodedPath = URLEncodedPath;

	objc_autoreleasePoolPop(pool);

	return ret;
}

- (OFURL *)URLByAppendingPathComponent: (OFString *)component
{
	OFMutableURL *ret = [self of_URLByAppendingPathComponent: component];
	[URL appendPathComponent: component];

#ifdef OF_HAVE_FILES
	if ([ret.scheme isEqual: @"file"]) {
		void *pool = objc_autoreleasePoolPush();

		if ([[OFFileManager defaultManager] directoryExistsAtURL: ret])
			ret.URLEncodedPath =
			    [ret.URLEncodedPath stringByAppendingString: @"/"];

		objc_autoreleasePoolPop(pool);
	}
#endif

	[ret makeImmutable];
	[URL makeImmutable];

	return ret;
	return URL;
}

- (OFURL *)URLByAppendingPathComponent: (OFString *)component
			   isDirectory: (bool)isDirectory
{
	OFMutableURL *ret = [self of_URLByAppendingPathComponent: component];

	OFMutableURL *URL = [[self mutableCopy] autorelease];
	if (isDirectory) {
		void *pool = objc_autoreleasePoolPush();

		ret.URLEncodedPath =
		    [ret.URLEncodedPath stringByAppendingString: @"/"];

	[URL appendPathComponent: component
		objc_autoreleasePoolPop(pool);
	}

	[ret makeImmutable];
		     isDirectory: isDirectory];
	[URL makeImmutable];

	return ret;
	return URL;
}

- (OFURL *)URLByStandardizingPath
{
	OFMutableURL *URL = [[self mutableCopy] autorelease];

	[URL standardizePath];