From 80eca904818397d0df2f148c4dd30014e7c40e79 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 13 Aug 2025 11:04:07 -0400 Subject: [PATCH] tagcache: Don't try to look up "deleted" filename entries When a file is deleted from the database, the first character of that entry is changed to \0. However the entry's length is not updated, because the entry is still using space in the index. When checking for deleted files, we were only keying on "length == 0" instead of also checking to see if the entry itself starts with \0. Change-Id: Ic00a0b29c3857c597ee5ff6ec01a5f4fd9633447 --- apps/tagcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 13777897bf..a45b08a691 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -503,7 +503,7 @@ read_tagfile_entry_and_tag(int fd, struct tagfile_entry *tfe, return e_TAG_SIZEMISMATCH; str_setlen(buf, tag_length); - return tag_length > 0 ? e_SUCCESS : e_SUCCESS_LEN_ZERO; + return (tag_length > 0 && *buf) ? e_SUCCESS : e_SUCCESS_LEN_ZERO; } static ssize_t read_index_entries(int fd, struct index_entry *buf, size_t count)