snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 755ef0ed9734c9b40809aafc687e673c3e7fabe3
parent c9b8f8cfef97f641015ab345fba81c074a8245b9
Author: default <nobody@localhost>
Date:   Fri,  8 Dec 2023 08:34:51 +0100

Purge unused tags completely.

Diffstat:
Mdata.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git 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); + } } }