diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index b96fd43609..8fd9b44fdc 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -293,13 +293,12 @@ File Project::resolveFilename (String filename) const if (filename.isEmpty()) return File::nonexistent; - filename = replacePreprocessorDefs (getPreprocessorDefs(), filename) - .replaceCharacter ('\\', '/'); + filename = replacePreprocessorDefs (getPreprocessorDefs(), filename); if (FileHelpers::isAbsolutePath (filename)) - return File::createFileWithoutCheckingPath (filename); // (avoid assertions for windows-style paths) + return File::createFileWithoutCheckingPath (FileHelpers::currentOSStylePath (filename)); // (avoid assertions for windows-style paths) - return getFile().getSiblingFile (filename); + return getFile().getSiblingFile (FileHelpers::currentOSStylePath (filename)); } String Project::getRelativePathForFile (const File& file) const diff --git a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp index cadd90bfcb..36f960bd2f 100644 --- a/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp +++ b/extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp @@ -102,14 +102,16 @@ namespace FileHelpers return false; } - String unixStylePath (const String& path) - { - return path.replaceCharacter ('\\', '/'); - } + String unixStylePath (const String& path) { return path.replaceCharacter ('\\', '/'); } + String windowsStylePath (const String& path) { return path.replaceCharacter ('/', '\\'); } - String windowsStylePath (const String& path) + String currentOSStylePath (const String& path) { - return path.replaceCharacter ('/', '\\'); + #if JUCE_WINDOWS + return windowsStylePath (path); + #else + return unixStylePath (path); + #endif } bool isAbsolutePath (const String& path) diff --git a/extras/Introjucer/Source/Utility/jucer_FileHelpers.h b/extras/Introjucer/Source/Utility/jucer_FileHelpers.h index 698f14f268..b93e089331 100644 --- a/extras/Introjucer/Source/Utility/jucer_FileHelpers.h +++ b/extras/Introjucer/Source/Utility/jucer_FileHelpers.h @@ -41,6 +41,7 @@ namespace FileHelpers String unixStylePath (const String& path); String windowsStylePath (const String& path); + String currentOSStylePath (const String& path); bool shouldPathsBeRelative (String path1, String path2); bool isAbsolutePath (const String& path);