From 3a2236abb0c46bde8ad9903ff056171058312072 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 8 Nov 2008 13:22:59 +0100 Subject: [PATCH] luaa: clean XDG_CONDIG_DIR package path adding Signed-off-by: Julien Danjou --- luaa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/luaa.c b/luaa.c index e7f7c9f0..2a05003c 100644 --- a/luaa.c +++ b/luaa.c @@ -852,9 +852,14 @@ luaA_init(void) lua_pushstring(L, AWESOME_RELEASE); lua_settable(L, LUA_GLOBALSINDEX); + /* add Lua lib path (/usr/share/awesome/lib by default) */ luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?.lua\""); luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?/init.lua\""); + /* add XDG_CONFIG_DIR (/etc/xdg/awesome by default) as include path */ + luaA_dostring(L, "package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?.lua\""); + luaA_dostring(L, "package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?/init.lua\""); + /* init hooks */ globalconf.hooks.manage = LUA_REFNIL; globalconf.hooks.unmanage = LUA_REFNIL; @@ -913,11 +918,6 @@ luaA_parserc(const char *confpatharg, bool run) ssize_t len; bool ret; - /* add XDG_CONFIG_DIR (/etc/xdg/awesome by default) as include path */ - snprintf(path, sizeof(path), - "package.path = package.path .. \";" XDG_CONFIG_DIR "/awesome/?.lua;" XDG_CONFIG_DIR "/awesome/?/init.lua\""); - luaA_dostring(globalconf.L, path); - ret = luaA_loadrc(confpatharg, run); confdir = getenv("XDG_CONFIG_HOME");