From: Michael Stapelberg Date: Sat, 19 Mar 2011 20:50:13 +0000 (+0100) Subject: Bugfix: correctly store the config path for using it for I3_CONFIG_PATH later X-Git-Tag: tree-pr3~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=626c65b0d81683b38b07a4106158a99781ce72e0;p=i3%2Fi3 Bugfix: correctly store the config path for using it for I3_CONFIG_PATH later --- diff --git a/include/config.h b/include/config.h index 57970e28..79343ab0 100644 --- a/include/config.h +++ b/include/config.h @@ -22,7 +22,7 @@ #include "i3.h" typedef struct Config Config; -extern const char *saved_configpath; +extern const char *current_configpath; extern Config config; extern SLIST_HEAD(modes_head, Mode) modes; diff --git a/src/config.c b/src/config.c index e4a4cac9..20b077b7 100644 --- a/src/config.c +++ b/src/config.c @@ -19,7 +19,7 @@ #include "all.h" -const char *saved_configpath = NULL; +const char *current_configpath = NULL; Config config; struct modes_head modes; @@ -233,19 +233,23 @@ static char *get_config_path() { * */ static void parse_configuration(const char *override_configpath) { + static const char *saved_configpath = NULL; if (override_configpath != NULL) { saved_configpath = override_configpath; + current_configpath = override_configpath; parse_file(override_configpath); return; } else if (saved_configpath != NULL) { + current_configpath = saved_configpath; parse_file(saved_configpath); return; } char *path = get_config_path(); DLOG("Parsing configfile %s\n", path); + current_configpath = path; parse_file(path); free(path); } diff --git a/src/main.c b/src/main.c index bde10aac..309fdaac 100644 --- a/src/main.c +++ b/src/main.c @@ -355,7 +355,7 @@ int main(int argc, char *argv[]) { (config.ipc_socket_path != NULL ? strlen(config.ipc_socket_path) : 0), config.ipc_socket_path); xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8, - strlen(saved_configpath), saved_configpath); + strlen(current_configpath), current_configpath); keysyms = xcb_key_symbols_alloc(conn);