summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-23 16:15:39 -0500
committerJune McEnroe <june@causal.agency>2021-01-23 16:15:39 -0500
commit61bd4079a0e2cb3817892580461407c8d009338d (patch)
treef6607ad48790caf5763d22463cd08c3567dc5a1b
parentFix /unignore command (diff)
downloadcatgirl-61bd4079a0e2cb3817892580461407c8d009338d.tar.gz
catgirl-61bd4079a0e2cb3817892580461407c8d009338d.zip
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.
Diffstat (limited to '')
-rw-r--r--filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/filter.c b/filter.c
index 2a7d564..a648d8b 100644
--- a/filter.c
+++ b/filter.c
@@ -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;
 	}
w=1'>Add The Awakened KingdomJune McEnroe 2020-09-12Move /opt/local back, cheat port select to use system manJune McEnroe 2020-09-12Move /opt/local behind /usr againJune McEnroe 2020-09-12Enable toc in cgit renderings of man pagesJune McEnroe 2020-09-11Install mandoc on macOSJune McEnroe 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe