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:
parent
c86722325a
commit
801d5d7170
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user