diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2009-08-06 06:18:22 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2009-08-06 06:18:22 +0000 |
| commit | 95344be6744d444c76075f9ea4866c94fec6f43f (patch) | |
| tree | 8e0300df9495b3db84660538fcf95ab7cb7bc4da /Source/Core/Common/Src/FileUtil.cpp | |
| parent | 43adc4f194778fdd098cfd1c46217da9b6d29ecb (diff) | |
misc cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3942 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 4c86d071e4..0879ede119 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -487,18 +487,20 @@ bool DeleteDirRecursively(const char *directory) return true; } -// Returns the current directory, caller should free -const char *GetCurrentDir() +// Returns the current directory +std::string GetCurrentDir() { - const char *dir; + char *dir; // Get the current working directory (getcwd uses malloc) if (!(dir = __getcwd(NULL, 0))) { ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", GetLastErrorMsg()); - return NULL; + return NULL; } - return dir; + std::string strDir = dir; + free(dir); + return strDir; } // Sets the current directory to the given directory @@ -577,14 +579,15 @@ std::string GetSysDirectory() sysDir = GetBundleDirectory(); sysDir += DIR_SEP; sysDir += SYSDATA_DIR; + sysDir += DIR_SEP; #elif defined __linux__ sysDir = SYSDATA_DIR; + sysDir += DIR_SEP; // FIXME global install #else - sysDir = SYSDATA_DIR; + sysDir = FULL_SYSDATA_DIR; #endif - sysDir += DIR_SEP; INFO_LOG(COMMON, "GetSysDirectory: Setting to %s:", sysDir.c_str()); return sysDir; } |
