From df70f50fdfcc69726f7d8fd186054dbe3e68c57e Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 26 Jun 2015 23:43:45 +0200 Subject: GetExeDirectory() shouldn't return paths with /../ in the middle. --- Source/Core/Common/FileUtil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/Core/Common/FileUtil.cpp') diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 4709c011b2..0b4a99bbd7 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -731,8 +731,12 @@ std::string& GetExeDirectory() if (DolphinPath.empty()) { TCHAR Dolphin_exe_Path[2048]; + TCHAR Dolphin_exe_Clean_Path[MAX_PATH]; GetModuleFileName(nullptr, Dolphin_exe_Path, 2048); - DolphinPath = TStrToUTF8(Dolphin_exe_Path); + if (_tfullpath(Dolphin_exe_Clean_Path, Dolphin_exe_Path, MAX_PATH) != nullptr) + DolphinPath = TStrToUTF8(Dolphin_exe_Clean_Path); + else + DolphinPath = TStrToUTF8(Dolphin_exe_Path); DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\')); } return DolphinPath; -- cgit v1.2.3 From d276d1abbbd0f71b9189da8b63bca6c3a4bc7ed4 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 26 Aug 2015 19:21:09 +0200 Subject: Fix VolumeDirectory Fixes the regression from a225426 and clarifies a related comment. --- Source/Core/Common/FileUtil.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/Common/FileUtil.cpp') diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 0b4a99bbd7..cd20316bbe 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -499,6 +499,7 @@ FSTEntry ScanDirectoryTree(const std::string &directory, bool recursive) entry = ScanDirectoryTree(physical_name, true); else entry.size = 0; + parent_entry.size += entry.size; } else { -- cgit v1.2.3 From cc036ca86cdaf709e01221975da734cb64d54a94 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Sep 2015 17:13:07 -0400 Subject: Common: Remove other Common prefixed headers from Common.h --- Source/Core/Common/FileUtil.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Source/Core/Common/FileUtil.cpp') diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index cd20316bbe..5fdac9e0ac 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -12,9 +12,11 @@ #include #include +#include "Common/CommonFuncs.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" +#include "Common/Logging/Log.h" #ifdef _WIN32 #include // for GetSaveFileName -- cgit v1.2.3