From b8a716c370a107ed7186f95ce3bf77c253ede53a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fernando=20Tarl=C3=A1=20Cardoso=20Lemos?= Date: Sun, 13 Mar 2011 20:32:54 -0300 Subject: [PATCH] Reload the same config file specified in the command line. Fixes: #346 --- src/config.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/config.c b/src/config.c index e7f4617b..80071d21 100644 --- a/src/config.c +++ b/src/config.c @@ -1,5 +1,5 @@ /* - * vim:ts=8:expandtab + * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager * @@ -232,15 +232,22 @@ static char *get_config_path() { * */ static void parse_configuration(const char *override_configpath) { - if (override_configpath != NULL) { - parse_file(override_configpath); - return; - } - - char *path = get_config_path(); - DLOG("Parsing configfile %s\n", path); - parse_file(path); - free(path); + static const char *saved_configpath = NULL; + + if (override_configpath != NULL) { + saved_configpath = override_configpath; + parse_file(override_configpath); + return; + } + else if (saved_configpath != NULL) { + parse_file(saved_configpath); + return; + } + + char *path = get_config_path(); + DLOG("Parsing configfile %s\n", path); + parse_file(path); + free(path); } /* -- 2.39.5