@@ -603,12 +603,18 @@ bool isDirectory; @try { void *pool = objc_autoreleasePoolPush(); - isDirectory = ([path hasSuffix: OF_PATH_DELIMITER_STRING] || +#if defined(OF_WINDOWS) || defined(OF_MSDOS) + isDirectory = ([path hasSuffix: @"\\"] || + [path hasSuffix: @"/"] || + [OFURLHandler_file of_directoryExistsAtPath: path]); +#else + isDirectory = ([path hasSuffix: @"/"] || [OFURLHandler_file of_directoryExistsAtPath: path]); +#endif objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; @@ -625,38 +631,32 @@ { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); -# if OF_PATH_DELIMITER != '/' || defined(OF_WINDOWS) || defined(OF_DJGPP) +# if defined(OF_WINDOWS) || defined(OF_DJGPP) OFArray OF_GENERIC(OFString *) *pathComponents = [path pathComponents]; -# endif -# if OF_PATH_DELIMITER != '/' path = [pathComponents componentsJoinedByString: @"/"]; -# endif -# if defined(OF_WINDOWS) || defined(OF_DJGPP) if ([[pathComponents firstObject] hasSuffix: @":"]) path = [path stringByPrependingString: @"/"]; # endif - if (isDirectory && ![path hasSuffix: OF_PATH_DELIMITER_STRING]) + if (isDirectory && ![path hasSuffix: @"/"]) path = [path stringByAppendingString: @"/"]; _URLEncodedScheme = @"file"; if (![path hasPrefix: @"/"]) { OFString *currentDirectoryPath = [[OFFileManager defaultManager] currentDirectoryPath]; -# if OF_PATH_DELIMITER != '/' +# if defined(OF_WINDOWS) || defined(OF_DJGPP) currentDirectoryPath = [[currentDirectoryPath pathComponents] componentsJoinedByString: @"/"]; -# endif -# if defined(OF_WINDOWS) || defined(OF_DJGPP) currentDirectoryPath = [currentDirectoryPath stringByPrependingString: @"/"]; # endif path = [currentDirectoryPath @@ -973,15 +973,12 @@ if ([path hasSuffix: @"/"]) path = [path substringWithRange: of_range(0, [path length] - 1)]; -#ifndef OF_PATH_STARTS_WITH_SLASH +#if defined(OF_WINDOWS) || defined(OF_MSDOS) path = [path substringWithRange: of_range(1, [path length] - 1)]; -#endif - -#if OF_PATH_DELIMITER != '/' path = [OFString pathWithComponents: [path componentsSeparatedByString: @"/"]]; #endif [path retain];