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.
This commit is contained in:
Brian Ashworth 2020-02-12 19:46:51 -05:00 committed by Simon Ser
parent 47763c99f9
commit 7999845357

View file

@ -202,8 +202,8 @@ static bool test_id(struct sway_container *container, void *data) {
static bool test_mark(struct sway_container *container, void *mark) { static bool test_mark(struct sway_container *container, void *mark) {
if (container->marks->length) { if (container->marks->length) {
return !list_seq_find(container->marks, return list_seq_find(container->marks,
(int (*)(const void *, const void *))strcmp, mark); (int (*)(const void *, const void *))strcmp, mark) != -1;
} }
return false; return false;
} }