From 77612a6dd99f58ee2fe8701cf1fd8009df19a21c Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Fri, 30 Aug 2019 13:01:47 +0200
Subject: Import partial previous patch, fix config path


diff --git a/gemdropx.c b/gemdropx.c
index 6af83e5..3125d2c 100644
--- a/gemdropx.c
+++ b/gemdropx.c
@@ -29,6 +29,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <unistd.h>
+#include <libgen.h>
 
 #ifndef EMBEDDED
 #include <SDL.h>
@@ -2560,7 +2561,10 @@ int main(int argc, char * argv[])
   SDL_version sdlver;
 #endif
   
-  
+  #ifdef __HAIKU__
+  chdir(dirname(argv[0]));
+  #endif
+
   no_music = 0;
   
   if (argc == 2)
@@ -2655,7 +2659,7 @@ int main(int argc, char * argv[])
   
   /* Get max level: */
   
-  sprintf(datafile, "%s/.gemdropx", getenv("HOME"));
+  sprintf(datafile, "%s/config/settings/gemdropx", getenv("HOME"));
   
   fi = fopen(datafile, "r");
   if (fi != NULL)
-- 
2.21.0

