From 8234da451795ae2557fbff928f187d3fb4cb8666 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 7 Nov 2008 16:35:21 +0100 Subject: [PATCH] luaa: add XDG_CONFIG_DIR as include path Signed-off-by: Julien Danjou --- luaa.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/luaa.c b/luaa.c index 0db69a93..92b32059 100644 --- a/luaa.c +++ b/luaa.c @@ -949,6 +949,14 @@ luaA_parserc(const char *confpatharg, bool run) xdg_config_dirs = XDG_CONFIG_DIR; len = sizeof(XDG_CONFIG_DIR) - 1; } + else + { + /* add XDG_CONFIG_DIR (/etc/xdg/awesome by default) as include path */ + snprintf(path, sizeof(path), + "package.path = package.path .. \";%s/awesome/?.lua;%s/awesome/?/init.lua\"", + XDG_CONFIG_DIR, XDG_CONFIG_DIR); + luaA_dostring(globalconf.L, path); + } xdg_files = a_strsplit(xdg_config_dirs, len, ':'); @@ -959,7 +967,9 @@ luaA_parserc(const char *confpatharg, bool run) confpath = p_new(char, len); a_strcpy(confpath, len, *buf); a_strcat(confpath, len, AWESOME_CONFIG_FILE); - snprintf(path, sizeof(path), "package.path = package.path .. \";%s/awesome/?.lua\"", *buf); + snprintf(path, sizeof(path), + "package.path = package.path .. \";%s/awesome/?.lua;%s/awesome/?/init.lua\"", + *buf, *buf); luaA_dostring(globalconf.L, path); if(!ret) ret = luaA_loadrc(confpath, run);