1
0
Fork 0

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
This commit is contained in:
Nate 2018-08-12 18:47:38 -04:00 committed by peterbell10
parent c86722325a
commit 801d5d7170
1 changed files with 5 additions and 2 deletions

View File

@ -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));
}