diff options
author | C. McEnroe | 2021-01-23 16:15:39 -0500 |
---|---|---|
committer | C. McEnroe | 2021-01-23 16:15:39 -0500 |
commit | 61bd4079a0e2cb3817892580461407c8d009338d (patch) | |
tree | f6607ad48790caf5763d22463cd08c3567dc5a1b | |
parent | 9adedc660b3b062a9843966dbf90632fb219de07 (diff) |
Preserve order of filters when removing
Filters should be kept in order since the first one that matches,
wins. This lets highlights or ignores take priority over each other,
if desired.
-rw-r--r-- | filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -74,7 +74,7 @@ bool filterRemove(struct Filter filter) { if (filter.chan && strcasecmp(filters[i].chan, filter.chan)) continue; if (filter.mesg && strcasecmp(filters[i].mesg, filter.mesg)) continue; free(filters[i].mask); - filters[i] = filters[--len]; + memmove(&filters[i], &filters[i + 1], sizeof(*filters) * --len); filters[len] = (struct Filter) {0}; found = true; } |