about 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;
 	}
commit/bin/Makefile?id=ab2ff3c40c39a56542d8806a3c87fd438cdaff25&follow=1'>Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe 2020-01-28Change scout sensitivity to 1.4June McEnroe 2020-01-28Import shows.txtJune McEnroe