Explicitly try the default configuration

Up to now we assumed that the default config is in a path where
xdgConfigFind() finds it. However, evidently this is not always the
case, so make this explicitly try the default configuration file.

Fixes: https://github.com/awesomeWM/awesome/issues/1346
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-01-25 09:21:38 +01:00
parent b9b59be816
commit 9922c3c8e9
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@"
#define XDG_CONFIG_DIR "@XDG_CONFIG_DIR@"
#define AWESOME_IS_BIG_ENDIAN @AWESOME_IS_BIG_ENDIAN@
#define AWESOME_DEFAULT_CONF "@AWESOME_SYSCONFDIR@/rc.lua"
#cmakedefine WITH_DBUS
#cmakedefine HAS_EXECINFO

7
luaa.c
View File

@ -885,8 +885,13 @@ luaA_find_config(xdgHandle* xdg, const char *confpatharg, luaA_config_callback *
}
tmp += a_strlen(tmp) + 1;
}
p_delete(&confpath);
if(callback(AWESOME_DEFAULT_CONF))
{
return a_strdup(AWESOME_DEFAULT_CONF);
}
return NULL;
}