Bugfix: correctly store the config path for using it for I3_CONFIG_PATH later
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user