about summary refs log tree commit diff
path: root/complete.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--complete.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/complete.c b/complete.c
index 5067512..437bb7d 100644
--- a/complete.c
+++ b/complete.c
@@ -122,3 +122,15 @@ void completeRemove(size_t id, const char *str) {
 		free(node);
 	}
 }
+
+void completeClear(size_t id) {
+	struct Node *next = NULL;
+	for (struct Node *node = head; node; node = next) {
+		next = node->next;
+		if (node->id != id) continue;
+		if (match == node) match = NULL;
+		detach(node);
+		free(node->str);
+		free(node);
+	}
+}