From 45576f56914f1bde330ada5f97dc74f7757ad564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Wed, 29 Nov 2017 16:01:07 +0100 Subject: [PATCH] Core/Directory: Fix recursive Create method on Posix --- src/Nazara/Core/Directory.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Nazara/Core/Directory.cpp b/src/Nazara/Core/Directory.cpp index 3a65c1153..d5076a09a 100644 --- a/src/Nazara/Core/Directory.cpp +++ b/src/Nazara/Core/Directory.cpp @@ -395,7 +395,7 @@ namespace Nz return false; #ifdef NAZARA_PLATFORM_WINDOWS - // Unlike to disk (Ex: "C:"), the netwrok path is not considered as a directory (Ex: "\\Laptop") + // Unlike to disk (Ex: "C:"), the network path is not considered as a directory (Ex: "\\Laptop") if (path.Match("\\\\*")) { foundPos = path.Find('\\', 2); @@ -414,11 +414,14 @@ namespace Nz if (p.EndsWith(NAZARA_DIRECTORY_SEPARATOR)) p = p.SubString(0, -2); - if (!DirectoryImpl::Exists(p) && !DirectoryImpl::Create(p)) - return false; + if (!p.IsEmpty()) + { + if (!DirectoryImpl::Exists(p) && !DirectoryImpl::Create(p)) + return false; - if (foundPos == String::npos) - break; + if (foundPos == String::npos) + break; + } foundPos = path.Find(NAZARA_DIRECTORY_SEPARATOR, foundPos + 1); }