From 7999845357bacac9c7599c899c0d6e88dac0791e Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 12 Feb 2020 19:46:51 -0500 Subject: cmd_swap: fix test_mark condition The condition in test_mark was checking the negation of list_seq_find. This works fine for the first mark, but fails for every other mark. This fixes the condition to check for anything other than -1, which is the value returned from list_seq_find for index not found. --- sway/commands/swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/swap.c b/sway/commands/swap.c index 697de226..a7f9691b 100644 --- a/sway/commands/swap.c +++ b/sway/commands/swap.c @@ -202,8 +202,8 @@ static bool test_id(struct sway_container *container, void *data) { static bool test_mark(struct sway_container *container, void *mark) { if (container->marks->length) { - return !list_seq_find(container->marks, - (int (*)(const void *, const void *))strcmp, mark); + return list_seq_find(container->marks, + (int (*)(const void *, const void *))strcmp, mark) != -1; } return false; } -- cgit v1.2.3-54-g00ecf