From 9922c3c8e927c6a24fb372f3ac827508e7e30079 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 25 Jan 2017 09:21:38 +0100 Subject: [PATCH] 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 --- config.h | 1 + luaa.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config.h b/config.h index b599a90e..26bb8c98 100644 --- a/config.h +++ b/config.h @@ -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 diff --git a/luaa.c b/luaa.c index 26e78bdb..f3e2b3d4 100644 --- a/luaa.c +++ b/luaa.c @@ -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; }