@@ -2092,10 +2092,30 @@ if (i < 0) i = 0; return [self substringWithRange: of_range(i, length - i)]; } + +- (OFString*)pathExtension +{ + void *pool = objc_autoreleasePoolPush(); + OFString *ret, *fileName; + size_t pos; + + fileName = [self lastPathComponent]; + pos = [fileName rangeOfString: @"." + options: OF_STRING_SEARCH_BACKWARDS].location; + if (pos == OF_NOT_FOUND || pos == 0) + return @""; + + ret = [fileName substringWithRange: + of_range(pos + 1, [fileName length] - pos - 1)]; + + [ret retain]; + objc_autoreleasePoolPop(pool); + return [ret autorelease]; +} - (OFString*)stringByDeletingLastPathComponent { void *pool; const of_unichar_t *characters; @@ -2172,11 +2192,10 @@ ret = [OFString pathWithComponents: components]; [ret retain]; objc_autoreleasePoolPop(pool); - return [ret autorelease]; } - (OFString*)stringByStandardizingPath {