From 57ee25e239cc77fa9c5b8bc8ad4fa05a2f4aa177 Mon Sep 17 00:00:00 2001 From: KentuckyCompass Date: Thu, 27 Dec 2012 06:36:00 -0800 Subject: [PATCH] Fix brain fart. --- Core/FileSystems/DirectoryFileSystem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 954dea960e..611f8b7e65 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -107,8 +107,12 @@ bool DirectoryFileSystem::FixPathCase(std::string &path, FixPathCaseBehavior beh { std::string component = path.substr(start, i - start); - if (FixFilenameCase(fullPath, component) == false) - return (behavior == FPC_FILE_MUST_EXIST || (behavior == FPC_PATH_MUST_EXIST && i >= len)); + // Fix case and stop on nonexistant path component + if (FixFilenameCase(fullPath, component) == false) { + // Still counts as success if partial matches allowed or if this + // is the last component and only the ones before it are required + return (behavior == FPC_PARTIAL_ALLOWED || (behavior == FPC_PATH_MUST_EXIST && i >= len)); + } path.replace(start, i - start, component);