After some investigation, I found it's not a matter of `uniq`. I have made this patch that will fix this.
From 64579c0109dfbd5844d8e645e3e1b7d2daaf7718 Mon Sep 17 00:00:00 2001
From: zyxwvu Shi <
i...@shiyc.cn>
Date: Thu, 3 Dec 2020 17:05:20 +0800
Subject: [PATCH] Fix multiple config item removal.
`lub_list_del` resets iter->next to NULL, and the later copied tmp->next
is also reset to NULL. This terminates the configuration iteration loop
and prevents all matching configuration from being deleted.
Signed-off-by: zyxwvu Shi <
i...@shiyc.cn>
---
konf/tree/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/konf/tree/tree.c b/konf/tree/tree.c
index db2fdff..7d9c787 100644
--- a/konf/tree/tree.c
+++ b/konf/tree/tree.c
@@ -272,9 +272,9 @@ int konf_tree_del_pattern(konf_tree_t *this,
res++;
continue;
}
+ lub_list_node_copy(tmp, iter);
lub_list_del(this->list, iter);
konf_tree_delete(conf);
- lub_list_node_copy(tmp, iter);
lub_list_node_free(iter);
iter = tmp;
del_cnt++;
--
2.24.3 (Apple Git-128)