From e550623b11378d7cfae2eee9371e8fa81967ec0c Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Tue, 19 Jun 2012 13:51:29 +0200 Subject: Added a button to dump the FakeVMEM from the memory debugger if the game uses it --- Source/Core/Common/Src/FileUtil.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 6dd800b723..4650c6e1ba 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -682,6 +682,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) paths[F_WIISYSCONF_IDX] = paths[D_WIISYSCONF_IDX] + WII_SYSCONF; paths[F_RAMDUMP_IDX] = paths[D_DUMP_IDX] + RAM_DUMP; paths[F_ARAMDUMP_IDX] = paths[D_DUMP_IDX] + ARAM_DUMP; + paths[F_FAKEVMEMDUMP_IDX] = paths[D_DUMP_IDX] + FAKEVMEM_DUMP; paths[F_GCSRAM_IDX] = paths[D_GCUSER_IDX] + GC_SRAM; } -- cgit v1.2.3 From 3b559d89ec39b4479bf97aa376f7e685997db0a3 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 14 Dec 2012 11:47:12 -0600 Subject: If the HOME environment variable isn't set, fall back on to PWD. Closes 5584. --- Source/Core/Common/Src/FileUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 4650c6e1ba..691685e99d 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -649,7 +649,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; else - paths[D_USER_IDX] = std::string(getenv("HOME")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; + paths[D_USER_IDX] = std::string(getenv("HOME") ? getenv("HOME") : getenv("PWD")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; #endif INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", paths[D_USER_IDX].c_str()); -- cgit v1.2.3 From 2db4549174620aa130ef012af26c2e1760c4928c Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 18 Dec 2012 23:35:28 -0600 Subject: Fix a memory leak based on Lioncash's patches. --- Source/Core/Common/Src/FileUtil.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 691685e99d..77aac45418 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -299,7 +299,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename) ERROR_LOG(COMMON, "Copy: failed reading from source, %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); - return false; + goto bail; } } @@ -310,13 +310,19 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename) ERROR_LOG(COMMON, "Copy: failed writing to output, %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); - return false; + goto bail; } } // close flushs fclose(input); fclose(output); return true; +bail: + if (input) + fclose(input); + if (output) + fclose(output); + return false; #endif } -- cgit v1.2.3 From 94116bf89c917309b7e7b2a2b46bf2f43f3219db Mon Sep 17 00:00:00 2001 From: rog Date: Wed, 26 Dec 2012 19:55:45 -0500 Subject: Always use the right user dir on windows. --- Source/Core/Common/Src/FileUtil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 77aac45418..77290528a6 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -649,8 +649,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) if (paths[D_USER_IDX].empty()) { #ifdef _WIN32 - // TODO: use GetExeDirectory() here instead of ROOT_DIR so that if the cwd is changed we still have the correct paths? - paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; + paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; #else if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; -- cgit v1.2.3