@@ -1138,76 +1138,30 @@ return [path autorelease]; } #endif -- (OFMutableURL *)of_URLByAppendingPathComponent: (OFString *)component -{ - OFMutableURL *ret = [[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]; - -#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]; - - return ret; + OFMutableURL *URL = [[self mutableCopy] autorelease]; + + [URL appendPathComponent: component]; + [URL makeImmutable]; + + return URL; } - (OFURL *)URLByAppendingPathComponent: (OFString *)component isDirectory: (bool)isDirectory { - OFMutableURL *ret = [self of_URLByAppendingPathComponent: component]; - - if (isDirectory) { - void *pool = objc_autoreleasePoolPush(); - - ret.URLEncodedPath = - [ret.URLEncodedPath stringByAppendingString: @"/"]; - - objc_autoreleasePoolPop(pool); - } - - [ret makeImmutable]; - - return ret; + OFMutableURL *URL = [[self mutableCopy] autorelease]; + + [URL appendPathComponent: component + isDirectory: isDirectory]; + [URL makeImmutable]; + + return URL; } - (OFURL *)URLByStandardizingPath { OFMutableURL *URL = [[self mutableCopy] autorelease];