summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 629bf46aba..a3585feea5 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -993,28 +993,25 @@ static bool check_clauses(struct tagcache_search *tcs,
993 { 993 {
994 int seek; 994 int seek;
995 char buf[256]; 995 char buf[256];
996 char *str; 996 char *str = buf;
997 struct tagcache_search_clause *clause = clauses[i]; 997 struct tagcache_search_clause *clause = clauses[i];
998 998
999 if (clause->type == clause_logical_or) 999 if (clause->type == clause_logical_or)
1000 break; /* all conditions before logical-or satisfied -- 1000 break; /* all conditions before logical-or satisfied --
1001 stop processing clauses */ 1001 stop processing clauses */
1002 1002
1003#ifdef HAVE_TC_RAMCACHE 1003 seek = check_virtual_tags(clause->tag, tcs->idx_id, idx);
1004 str = NULL;
1005 1004
1005#ifdef HAVE_TC_RAMCACHE
1006 if (tcs->ramsearch) 1006 if (tcs->ramsearch)
1007 { 1007 {
1008 struct tagfile_entry *tfe; 1008 struct tagfile_entry *tfe;
1009 1009
1010 seek = check_virtual_tags(clause->tag, tcs->idx_id, idx);
1011
1012 if (!TAGCACHE_IS_NUMERIC(clause->tag)) 1010 if (!TAGCACHE_IS_NUMERIC(clause->tag))
1013 { 1011 {
1014 if (clause->tag == tag_filename) 1012 if (clause->tag == tag_filename)
1015 { 1013 {
1016 retrieve(tcs, idx, tag_filename, buf, sizeof buf); 1014 retrieve(tcs, idx, tag_filename, buf, sizeof buf);
1017 str = buf;
1018 } 1015 }
1019 else 1016 else
1020 { 1017 {
@@ -1027,11 +1024,7 @@ static bool check_clauses(struct tagcache_search *tcs,
1027#endif 1024#endif
1028 { 1025 {
1029 struct tagfile_entry tfe; 1026 struct tagfile_entry tfe;
1030 str = buf;
1031 1027
1032 seek = check_virtual_tags(clause->tag, tcs->idx_id, idx);
1033
1034 memset(buf, 0, sizeof buf);
1035 if (!TAGCACHE_IS_NUMERIC(clause->tag)) 1028 if (!TAGCACHE_IS_NUMERIC(clause->tag))
1036 { 1029 {
1037 int fd = tcs->idxfd[clause->tag]; 1030 int fd = tcs->idxfd[clause->tag];
@@ -1044,6 +1037,7 @@ static bool check_clauses(struct tagcache_search *tcs,
1044 } 1037 }
1045 1038
1046 read(fd, str, tfe.tag_length); 1039 read(fd, str, tfe.tag_length);
1040 str[tfe.tag_length] = '\0';
1047 1041
1048 /* Check if entry has been deleted. */ 1042 /* Check if entry has been deleted. */
1049 if (str[0] == '\0') 1043 if (str[0] == '\0')