From 4fa0883d46be3b65c6e4143922d0a505cbc5e9c2 Mon Sep 17 00:00:00 2001 From: yvt Date: Mon, 26 Aug 2013 02:07:34 +0900 Subject: [PATCH] Missing resource directory is automatically created (on windows) --- Sources/Core/DirectoryFileSystem.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Core/DirectoryFileSystem.cpp b/Sources/Core/DirectoryFileSystem.cpp index ac78c45f2..119e7c734 100644 --- a/Sources/Core/DirectoryFileSystem.cpp +++ b/Sources/Core/DirectoryFileSystem.cpp @@ -131,12 +131,13 @@ namespace spades { std::string path = physicalPath(fn); // create required directory - if(path.find('/') != std::string::npos){ - size_t pos = path.find('/') + 1; + if(path.find_first_of("/\\") != std::string::npos){ + size_t pos = path.find_first_of("/\\") + 1; while(pos < path.size()){ size_t nextPos = pos; while(nextPos < path.size() && - path[nextPos] != '/') + path[nextPos] != '/' && + path[nextPos] != '\\') nextPos++; if(nextPos == path.size()) break;