summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 1106f095..4eaa210f 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -804,14 +804,12 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
804 } 804 }
805 } 805 }
806 806
807 for (i = 0; i < config->output_configs->length; ++i) { 807 i = list_seq_find(config->output_configs, output_name_cmp, name);
808 if (i >= 0) {
809 // replace existing config
808 struct output_config *oc = config->output_configs->items[i]; 810 struct output_config *oc = config->output_configs->items[i];
809 if (strcmp(oc->name, output->name) == 0) { 811 list_del(config->output_configs, i);
810 // replace existing config 812 free_output_config(oc);
811 list_del(config->output_configs, i);
812 free_output_config(oc);
813 break;
814 }
815 } 813 }
816 list_add(config->output_configs, output); 814 list_add(config->output_configs, output);
817 815