commit 4df4f0c

default  ·  2025-02-05 08:47:38 +0000 UTC
parent 879fcd8
Fixed bug in search.
1 files changed,  +11, -1
M data.c
M data.c
+11, -1
 1@@ -2766,7 +2766,17 @@ xs_list *content_search(snac *user, const char *regex,
 2         for (int n = 0; n < 3; n++) {
 3             if (md5s[n] != NULL) {
 4                 xs *fn = _object_fn_by_md5(md5s[n], "content_search");
 5-                double mt = mtime(fn);
 6+                double mt;
 7+
 8+                while ((mt = mtime(fn)) == 0 && md5s[n] != NULL) {
 9+                    /* object is not here: move to the next one */
10+                    if (xs_list_next(tls[n], &md5s[n], &c[n])) {
11+                        xs_free(fn);
12+                        fn = _object_fn_by_md5(md5s[n], "content_search_2");
13+                    }
14+                    else
15+                        md5s[n] = NULL;
16+                }
17 
18                 if (mt > mtime) {
19                     newest = n;