diff options
author | rubidium <rubidium@openttd.org> | 2010-02-17 16:45:55 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-02-17 16:45:55 +0000 |
commit | ef90fa7d022849546603e9a9ec26e383f40620bf (patch) | |
tree | 920cfae3f75d33b4692bc9d868a0df215a2dd4ae /src | |
parent | 9f27959fcd7fff0b89a737a7ec37e425d3f04d37 (diff) | |
download | openttd-ef90fa7d022849546603e9a9ec26e383f40620bf.tar.xz |
(svn r19151) -Codechange [FS#3625]: Move home directory to a better place in Haiku (jrepan)
Diffstat (limited to 'src')
-rw-r--r-- | src/ai/api/ai_changelog.hpp | 2 | ||||
-rw-r--r-- | src/fileio.cpp | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ai/api/ai_changelog.hpp b/src/ai/api/ai_changelog.hpp index 952ac7540..d554b4418 100644 --- a/src/ai/api/ai_changelog.hpp +++ b/src/ai/api/ai_changelog.hpp @@ -16,7 +16,7 @@ * * \b 1.1.0 * - * 1.0.0 is not yet released. The following changes are not set in stone yet. + * 1.1.0 is not yet released. The following changes are not set in stone yet. * * \b 1.0.0 * diff --git a/src/fileio.cpp b/src/fileio.cpp index e966208fb..3b18da7a6 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -18,6 +18,9 @@ #include "tar_type.h" #ifdef WIN32 #include <windows.h> +#elif defined(__HAIKU__) +#include <Path.h> +#include <storage/FindDirectory.h> #else #ifdef OPENBSD #include <unistd.h> @@ -849,12 +852,18 @@ void DetermineBasePaths(const char *exe) #if defined(__MORPHOS__) || defined(__AMIGA__) || defined(DOS) || defined(OS2) || !defined(WITH_PERSONAL_DIR) _searchpaths[SP_PERSONAL_DIR] = NULL; #else +#ifdef __HAIKU__ + BPath path; + find_directory(B_USER_SETTINGS_DIRECTORY, &path); + const char *homedir = path.Path(); +#else const char *homedir = getenv("HOME"); if (homedir == NULL) { const struct passwd *pw = getpwuid(getuid()); homedir = (pw == NULL) ? "" : pw->pw_dir; } +#endif snprintf(tmp, MAX_PATH, "%s" PATHSEP "%s", homedir, PERSONAL_DIR); AppendPathSeparator(tmp, MAX_PATH); |