@@ -2040,26 +2040,10 @@ [new makeImmutable]; return new; } -- (OFString *)stringByAppendingURLPathComponent: (OFString *)component -{ - if ([self hasSuffix: @"/"]) - return [self stringByAppendingString: component]; - else { - OFMutableString *ret = [[self mutableCopy] autorelease]; - - [ret appendString: @"/"]; - [ret appendString: component]; - - [ret makeImmutable]; - - return ret; - } -} - - (OFString *)stringByPrependingString: (OFString *)string { OFMutableString *new = [[string mutableCopy] autorelease]; [new appendString: self]; @@ -2329,71 +2313,10 @@ objc_autoreleasePoolPop(pool); return array; } -- (OFString *)stringByStandardizingURLPath -{ - void *pool = objc_autoreleasePoolPush(); - OFArray OF_GENERIC(OFString *) *components = - [self componentsSeparatedByString: @"/"]; - OFMutableArray OF_GENERIC(OFString *) *array; - OFString *ret; - bool done = false, startsWithEmpty, endsWithEmpty; - - array = [[components mutableCopy] autorelease]; - - if ((startsWithEmpty = [[array firstObject] isEqual: @""])) - [array removeObjectAtIndex: 0]; - endsWithEmpty = [[array lastObject] isEqual: @""]; - - while (!done) { - size_t length = [array count]; - - done = true; - - for (size_t i = 0; i < length; i++) { - id object = [array objectAtIndex: i]; - id parent; - - if (i > 0) - parent = [array objectAtIndex: i - 1]; - else - parent = nil; - - if ([object isEqual: @"."] || - [object length] == 0) { - [array removeObjectAtIndex: i]; - - done = false; - break; - } - - if ([object isEqual: @".."] && parent != nil && - ![parent isEqual: @".."]) { - [array removeObjectsInRange: - of_range(i - 1, 2)]; - - done = false; - break; - } - } - } - - if (startsWithEmpty) - [array insertObject: @"" - atIndex: 0]; - if (endsWithEmpty) - [array addObject: @""]; - - ret = [[array componentsJoinedByString: @"/"] retain]; - - objc_autoreleasePoolPop(pool); - - return [ret autorelease]; -} - - (intmax_t)decimalValue { void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters = [self characters]; size_t i = 0, length = [self length];