From 801d5d7170f15b6075cfbf15fa3fe5a074611a96 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 12 Aug 2018 18:47:38 -0400 Subject: Fix: Create players folder recursively (#4283) Problem: On a new server the players folder was not created on windows. Root Cause: `GetUUIDFolderName` was returning a folder structure for players with `/` while CreateFolderRecursively was checking for `\\` for win32. The fix is to recognise both forward and backward slashes as file separators on windows. Fixes #4284 --- src/OSSupport/File.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index d9b3d86d3..3dd97f36c 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -474,10 +474,13 @@ bool cFile::CreateFolderRecursive(const AString & a_FolderPath) // Go through each path element and create the folder: auto len = a_FolderPath.length(); - auto PathSep = GetPathSeparator()[0]; for (decltype(len) i = 0; i < len; i++) { - if (a_FolderPath[i] == PathSep) + #ifdef _WIN32 + if ((a_FolderPath[i] == '\\') || (a_FolderPath[i] == '/')) + #else + if (a_FolderPath[i] == '/') + #endif { CreateFolder(a_FolderPath.substr(0, i)); } -- cgit v1.2.3