diff options
Diffstat (limited to 'src/LuaSL/LuaSL_main.c')
-rw-r--r-- | src/LuaSL/LuaSL_main.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 0d8a6db..7d6fa99 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c | |||
@@ -221,8 +221,23 @@ static Eina_Bool _del(void *data, int type __UNUSED__, Ecore_Con_Event_Client_De | |||
221 | 221 | ||
222 | int main(int argc, char **argv) | 222 | int main(int argc, char **argv) |
223 | { | 223 | { |
224 | gameGlobals ourGlobals; | 224 | gameGlobals ourGlobals; |
225 | int result = EXIT_FAILURE; | 225 | char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; |
226 | int result = EXIT_FAILURE; | ||
227 | |||
228 | // Sigh, Elm has this great thing for dealing with bin, lib, and data directories, but this is not an Elm app, | ||
229 | // And Elm is too heavy for just that little bit. | ||
230 | // So just duplicate a bit of what we need here. Sorta. | ||
231 | getcwd(cwd, PATH_MAX); | ||
232 | env = getenv("LUA_CPATH"); | ||
233 | if (!env) env = ""; | ||
234 | sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, PACKAGE_LIB_DIR, PACKAGE_LIB_DIR, cwd); | ||
235 | setenv("LUA_CPATH", temp, 1); | ||
236 | |||
237 | env = getenv("LUA_PATH"); | ||
238 | if (!env) env = ""; | ||
239 | sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, PACKAGE_LIB_DIR, cwd); | ||
240 | setenv("LUA_PATH", temp, 1); | ||
226 | 241 | ||
227 | memset(&ourGlobals, 0, sizeof(gameGlobals)); | 242 | memset(&ourGlobals, 0, sizeof(gameGlobals)); |
228 | ourGlobals.address = "127.0.0.1"; | 243 | ourGlobals.address = "127.0.0.1"; |