From 333084250591d0cd2e88ebdb722a36003c2ae213 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sun, 17 Feb 2013 01:33:22 -0600 Subject: [PATCH] Let's not CreateDir an empty string every time CreateFullPath is used, logging an error every time. --- Source/Core/Common/Src/FileUtil.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index d74c99b7a2..8e1bec2809 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -196,8 +196,9 @@ bool CreateFullPath(const std::string &fullPath) // we're done, yay! if (position == fullPath.npos) return true; - - std::string subPath = fullPath.substr(0, position); + + // Include the '/' so the first call is CreateDir("/") rather than CreateDir("") + std::string const subPath(fullPath.substr(0, position + 1)); if (!File::IsDirectory(subPath)) File::CreateDir(subPath);