Changeset - r14568:64647c10b607
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2010-02-17 16:45:55
rubidium@openttd.org
(svn r19151) -Codechange [FS#3625]: Move home directory to a better place in Haiku (jrepan)
3 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1015,13 +1015,13 @@ check_params() {
 
		fi
 
	else
 
		icon_theme_dir="`echo $icon_theme_dir | sed 's@\([^\]\)\\\\ @\1\\\\\\\\ @g;s@\([^\]\) @\1\\\\\\\\ @g'`"
 
	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"
 
		else
 
			personal_dir=".openttd"
 
		fi
src/ai/api/ai_changelog.hpp
Show inline comments
 
@@ -13,13 +13,13 @@
 
 * bug fixes can be found in the normal changelog. Note that removed API
 
 * functions may still be available if you return an older API version
 
 * in GetAPIVersion() in info.nut.
 
 *
 
 * \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
 
 *
 
 * 1.0.0 is not yet released. The following changes are not set in stone yet.
 
 *
 
 * API additions:
src/fileio.cpp
Show inline comments
 
@@ -15,12 +15,15 @@
 
#include "debug.h"
 
#include "fios.h"
 
#include "string_func.h"
 
#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>
 
#endif
 
#include <pwd.h>
 
#endif
 
@@ -846,18 +849,24 @@ void ChangeWorkingDirectory(const char *
 
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");
 

	
 
	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);
 

	
 
	_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
 
#endif
0 comments (0 inline, 0 general)