From 4e679cd9f9cb725773053295eedc75adb8ebe41c Mon Sep 17 00:00:00 2001 From: Klaus Ethgen Date: Sun, 7 Mar 2010 14:57:00 +0100 Subject: [PATCH] Using common path for lua files --- src/lua.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lua.c b/src/lua.c index 64cb0427..18d11f4a 100644 --- a/src/lua.c +++ b/src/lua.c @@ -30,6 +30,7 @@ #include #include "glua.h" +#include "ui_fileops.h" static lua_State *L; /** The LUA object needed for all operations (NOTE: That is * a upper-case variable to match the documentation!) */ @@ -50,6 +51,8 @@ gchar *lua_callvalue(gchar *file, gchar *function) { gint result; gchar *data = NULL; + gchar *dir; + gchar *path; if (file[0] == '\0') { @@ -57,7 +60,11 @@ gchar *lua_callvalue(gchar *file, gchar *function) } else { - result = luaL_dofile(L, file); + dir = g_build_filename(get_rc_dir(), "lua", NULL); + path = g_build_filename(dir, file, NULL); + result = luaL_dofile(L, path); + g_free(path); + g_free(dir); } if (result) -- 2.20.1