aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index 11394a7c..23d6ac0d 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -102,6 +102,7 @@ static void config_defaults(struct sway_config *config) {
102 config->active = false; 102 config->active = false;
103 config->failed = false; 103 config->failed = false;
104 config->auto_back_and_forth = false; 104 config->auto_back_and_forth = false;
105 config->reading = false;
105 106
106 config->gaps_inner = 0; 107 config->gaps_inner = 0;
107 config->gaps_outer = 0; 108 config->gaps_outer = 0;
@@ -217,6 +218,7 @@ bool read_config(FILE *file, bool is_active) {
217 config = malloc(sizeof(struct sway_config)); 218 config = malloc(sizeof(struct sway_config));
218 219
219 config_defaults(config); 220 config_defaults(config);
221 config->reading = true;
220 if (is_active) { 222 if (is_active) {
221 sway_log(L_DEBUG, "Performing configuration file reload"); 223 sway_log(L_DEBUG, "Performing configuration file reload");
222 config->reloading = true; 224 config->reloading = true;
@@ -228,7 +230,8 @@ bool read_config(FILE *file, bool is_active) {
228 while (!feof(file)) { 230 while (!feof(file)) {
229 line = read_line(file); 231 line = read_line(file);
230 line = strip_comments(line); 232 line = strip_comments(line);
231 if (!config_command(line)) { 233 if (config_command(line) == CMD_FAILURE) {
234 sway_log(L_ERROR, "Error on line '%s'", line);
232 success = false; 235 success = false;
233 } 236 }
234 free(line); 237 free(line);
@@ -242,6 +245,7 @@ bool read_config(FILE *file, bool is_active) {
242 free_config(old_config); 245 free_config(old_config);
243 } 246 }
244 247
248 config->reading = false;
245 return success; 249 return success;
246} 250}
247 251