From 1f268374d0eb8959082ba8d42aad35bfe264dae0 Mon Sep 17 00:00:00 2001
From: Humdinger <humdingerb@gmail.com>
Date: Sat, 5 Sep 2015 11:03:52 +0200
Subject: Put settings in the right folder for Haiku.


diff --git a/src/slime.c b/src/slime.c
index 683d04a..0125baa 100644
--- a/src/slime.c
+++ b/src/slime.c
@@ -39,6 +39,10 @@ $Id: slime.c 257 2008-11-23 10:03:21Z vinduv $
 
 #include "credits.h"
 
+#ifdef __HAIKU__
+	#include <storage/FindDirectory.h>
+#endif
+
 #ifdef WINDOWS
 	#define CONFIG_NOM "slime.ini"
 	#define SEP "\\"
@@ -236,7 +240,7 @@ int main(int argc, char* argv[]) {
 		chemin_moi = argv[0];
 	}
 
-#ifndef MACOS9
+#ifndef MACOS9 || __HAIKU__
 	if(getenv(DOSS_PREFS) != NULL) {
 		conf_chemin[0] = '\0';
 		strncat(conf_chemin, getenv(DOSS_PREFS), sizeof(conf_chemin));
@@ -245,6 +249,15 @@ int main(int argc, char* argv[]) {
 	}
 #endif
 
+#ifdef __HAIKU__
+	conf_chemin[256] = '\0';
+	find_directory(B_USER_SETTINGS_DIRECTORY, 0, true, conf_chemin, sizeof(conf_chemin));
+	if(conf_chemin != NULL) {
+		strncat(conf_chemin, "/", sizeof(conf_chemin));
+		strncat(conf_chemin, "Slime_Volley", sizeof(conf_chemin));
+	}
+#endif
+
 	config_fich = fopen(conf_chemin, "rb");
 
 	if(config_fich == NULL) {
-- 
2.2.2

