From db1a89a4924cfb2ed070f5bcc81b89429d61abbf Mon Sep 17 00:00:00 2001 From: amzn-phist <52085794+amzn-phist@users.noreply.github.com> Date: Wed, 25 Aug 2021 17:43:04 -0500 Subject: [PATCH] Fix level creation on Linux (#3488) * Fix level creation on Linux Creating a new level on linux would fail due to backslashes being used in mkdir. Fixed the slashes to use the AZ_CORRECT_FILESYSTEM_SEPARATOR. Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> * Removed extra line that wasn't needed Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com> --- Code/Editor/Util/FileUtil.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp index 435ec67a99..610a9c6e16 100644 --- a/Code/Editor/Util/FileUtil.cpp +++ b/Code/Editor/Util/FileUtil.cpp @@ -1221,15 +1221,14 @@ bool CFileUtil::CreatePath(const QString& strPath) if (!strDriveLetter.isEmpty()) { strCurrentDirectoryPath = strDriveLetter; - strCurrentDirectoryPath += "\\"; + strCurrentDirectoryPath += AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING; } - nTotalPathQueueElements = cstrDirectoryQueue.size(); for (nCurrentPathQueue = 0; nCurrentPathQueue < nTotalPathQueueElements; ++nCurrentPathQueue) { strCurrentDirectoryPath += cstrDirectoryQueue[static_cast(nCurrentPathQueue)]; - strCurrentDirectoryPath += "\\"; + strCurrentDirectoryPath += AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING; // The value which will go out of this loop is the result of the attempt to create the // last directory, only. @@ -2158,7 +2157,6 @@ uint32 CFileUtil::GetAttributes(const char* filename, bool bUseSourceControl /*= return SCC_FILE_ATTRIBUTE_READONLY | SCC_FILE_ATTRIBUTE_INPAK; } - const char* adjustedFile = file.GetAdjustedFilename(); if (!AZ::IO::SystemFile::Exists(adjustedFile)) {