summaryrefslogtreecommitdiffstats
path: root/src/common/file_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/file_util.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index 78a642599..35da07306 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -13,6 +13,7 @@
#include <commdlg.h> // for GetSaveFileName
#include <io.h>
#include <direct.h> // getcwd
+#include <tchar.h>
#else
#include <sys/param.h>
#include <dirent.h>
@@ -190,8 +191,10 @@ bool CreateFullPath(const std::string &fullPath)
// Include the '/' so the first call is CreateDir("/") rather than CreateDir("")
std::string const subPath(fullPath.substr(0, position + 1));
- if (!FileUtil::IsDirectory(subPath))
- FileUtil::CreateDir(subPath);
+ if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) {
+ ERROR_LOG(COMMON, "CreateFullPath: directory creation failed");
+ return false;
+ }
// A safety check
panicCounter--;