From 31c3e663a88b76a6085a9ef73cc00a23601f333d Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 29 May 2016 20:36:53 +0200 Subject: [PATCH] Fixed: Create Ryzom profile folder if not already created and return 1 if unable to create it --- code/ryzom/client/src/client.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index dcce43cc0..f2eaf64c0 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -203,13 +203,18 @@ int main(int argc, char **argv) { std::string currentPath = CPath::getApplicationDirectory("Ryzom"); - // append profile ID to directory - if (Args.haveArg("p")) - currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("p").front(); - + // create parent directory if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); - CPath::setCurrentPath(currentPath); + // append profile ID to directory + if (Args.haveArg("p")) + { + currentPath = NLMISC::CPath::standardizePath(currentPath) + Args.getArg("p").front(); + + if (!CFile::isExists(currentPath)) CFile::createDirectory(currentPath); + } + + if (!CPath::setCurrentPath(currentPath)) return 1; } #ifdef TEST_CRASH_COUNTER