aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-01 11:13:48 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-01 11:17:15 +1000
commitebe65a4d481341d38b99e8fb36e66832888bc085 (patch)
treec88027b2dc43606bc3601a5b18f8e719553299cb /sway/commands/bind.c
parentMerge pull request #2546 from RyanDwyer/fix-transaction-spamming (diff)
downloadsway-ebe65a4d481341d38b99e8fb36e66832888bc085.tar.gz
sway-ebe65a4d481341d38b99e8fb36e66832888bc085.tar.zst
sway-ebe65a4d481341d38b99e8fb36e66832888bc085.zip
Fix crash on reload
If sway is reloaded using a bindsym which has multiple commands, it failed to detect the reload command, didn't create a duplicate of the binding and would crash because the reload command frees the bindings. For example: mode system { bindsym r reload, mode default } In this example, the binding->command is "reload, mode default". Fixes #2545
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 8270b958..e73b0aea 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -310,7 +310,7 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding)
310 bool reload = false; 310 bool reload = false;
311 // if this is a reload command we need to make a duplicate of the 311 // if this is a reload command we need to make a duplicate of the
312 // binding since it will be gone after the reload has completed. 312 // binding since it will be gone after the reload has completed.
313 if (strcasecmp(binding->command, "reload") == 0) { 313 if (strncasecmp(binding->command, "reload", 6) == 0) {
314 reload = true; 314 reload = true;
315 binding_copy = sway_binding_dup(binding); 315 binding_copy = sway_binding_dup(binding);
316 if (!binding_copy) { 316 if (!binding_copy) {