aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-01-14 11:44:18 -0500
committerGitHub <noreply@github.com>2019-01-14 11:44:18 -0500
commit15cd8b6a86295a445a1037afd0028b1226a14c82 (patch)
tree56332b9c150459beb5aef94605372ef179ec8854 /sway/config.c
parent64ef9366733d6d332a24897f72eba90ba2adca1e (diff)
parent2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 (diff)
Merge pull request #3403 from mstoeckl/ipcleanup
Remove 'input' field of IPC command return json
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/config.c b/sway/config.c
index 18fee404..d5d36306 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -710,11 +710,12 @@ bool read_config(FILE *file, struct sway_config *config,
config->current_config_line_number = line_number;
config->current_config_line = line;
struct cmd_results *res;
+ char *new_block = NULL;
if (block && strcmp(block, "<commands>") == 0) {
// Special case
res = config_commands_command(expanded);
} else {
- res = config_command(expanded);
+ res = config_command(expanded, &new_block);
}
switch(res->status) {
case CMD_FAILURE:
@@ -740,9 +741,9 @@ bool read_config(FILE *file, struct sway_config *config,
break;
case CMD_BLOCK:
- wlr_log(WLR_DEBUG, "Entering block '%s'", res->input);
- list_insert(stack, 0, strdup(res->input));
- if (strcmp(res->input, "bar") == 0) {
+ wlr_log(WLR_DEBUG, "Entering block '%s'", new_block);
+ list_insert(stack, 0, strdup(new_block));
+ if (strcmp(new_block, "bar") == 0) {
config->current_bar = NULL;
}
break;
@@ -764,6 +765,7 @@ bool read_config(FILE *file, struct sway_config *config,
sizeof(config->handler_context));
default:;
}
+ free(new_block);
free(expanded);
free_cmd_results(res);
}