fixed determining program main data path for Mac OS X
authorHolger Schemel <info@artsoft.org>
Fri, 6 Jan 2017 18:13:28 +0000 (19:13 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 6 Jan 2017 18:13:28 +0000 (19:13 +0100)
src/libgame/misc.c

index 559fd38..bf40ca9 100644 (file)
@@ -701,6 +701,10 @@ static char *getProgramMainDataPath()
   // cut trailing path separator from path (but not if path is root directory)
   if (strSuffix(main_data_path, "/") && !strEqual(main_data_path, "/"))
     main_data_path[strlen(main_data_path) - 1] = '\0';
+
+  // replace empty path with current directory
+  if (strEqual(main_data_path, ""))
+    main_data_path = ".";
 #endif
 
   return main_data_path;