changeset 2198:a51edfa978a8

Using common path for lua files
author Klaus Ethgen <Klaus@Ethgen.de>
date Sun, 07 Mar 2010 14:57:00 +0100
parents ef11ba400848
children 4e1f60bc8518
files src/lua.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lua.c	Thu Mar 04 21:05:13 2010 +0100
+++ b/src/lua.c	Sun Mar 07 14:57:00 2010 +0100
@@ -30,6 +30,7 @@
 #include <glib.h>
 
 #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 @@
 {
 	gint result;
 	gchar *data = NULL;
+	gchar *dir;
+	gchar *path;
 
 	if (file[0] == '\0')
 		{
@@ -57,7 +60,11 @@
 		}
 	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)