From ef90fa7d022849546603e9a9ec26e383f40620bf Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 17 Feb 2010 16:45:55 +0000 Subject: (svn r19151) -Codechange [FS#3625]: Move home directory to a better place in Haiku (jrepan) --- config.lib | 2 +- src/ai/api/ai_changelog.hpp | 2 +- src/fileio.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config.lib b/config.lib index 20f721a3c..a984b8146 100644 --- a/config.lib +++ b/config.lib @@ -1018,7 +1018,7 @@ check_params() { fi if [ "$personal_dir" = "1" ]; then - if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ] || [ "$os" = "DOS" ]; then + if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ] || [ "$os" = "DOS" ] || [ "$os" == "HAIKU" ]; then personal_dir="OpenTTD" elif [ "$os" = "OSX" ]; then personal_dir="Documents/OpenTTD" 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 +#elif defined(__HAIKU__) +#include +#include #else #ifdef OPENBSD #include @@ -848,6 +851,11 @@ void DetermineBasePaths(const char *exe) char tmp[MAX_PATH]; #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"); @@ -855,6 +863,7 @@ void DetermineBasePaths(const char *exe) 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); -- cgit v1.2.3-70-g09d2