From 755ef0ed9734c9b40809aafc687e673c3e7fabe3 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 8 Dec 2023 08:34:51 +0100 Subject: [PATCH] Purge unused tags completely. --- data.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/data.c b/data.c index 67d6843..b62a1c1 100644 --- a/data.c +++ b/data.c @@ -2537,6 +2537,14 @@ void purge_server(void) tag_gc += index_gc(v2); xs *bak = xs_fmt("%s.bak", v2); unlink(bak); + + if (index_len(v2) == 0) { + /* there are no longer any entry with this tag; + purge it completely */ + unlink(v2); + xs *dottag = xs_replace(v2, ".idx", ".tag"); + unlink(dottag); + } } }