luaa: just expand path

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-07 16:57:11 +01:00
parent 8234da4517
commit 278ec5acd4
1 changed files with 5 additions and 8 deletions

13
luaa.c
View File

@ -913,6 +913,11 @@ 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");
@ -949,14 +954,6 @@ 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, ':');