diff options
| author | 2025-02-05 09:47:38 +0100 | |
|---|---|---|
| committer | 2025-02-05 09:47:38 +0100 | |
| commit | 4df4f0c5518cfe8ae90d098612e9d131f4a384f5 (patch) | |
| tree | ca7c55fd75cd40fb460388b001a7b62a14e0dfb6 /data.c | |
| parent | Updated TODO. (diff) | |
| download | snac2-4df4f0c5518cfe8ae90d098612e9d131f4a384f5.tar.gz snac2-4df4f0c5518cfe8ae90d098612e9d131f4a384f5.tar.xz snac2-4df4f0c5518cfe8ae90d098612e9d131f4a384f5.zip | |
Fixed bug in search.
Diffstat (limited to '')
| -rw-r--r-- | data.c | 12 |
1 files changed, 11 insertions, 1 deletions
| @@ -2766,7 +2766,17 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2766 | for (int n = 0; n < 3; n++) { | 2766 | for (int n = 0; n < 3; n++) { |
| 2767 | if (md5s[n] != NULL) { | 2767 | if (md5s[n] != NULL) { |
| 2768 | xs *fn = _object_fn_by_md5(md5s[n], "content_search"); | 2768 | xs *fn = _object_fn_by_md5(md5s[n], "content_search"); |
| 2769 | double mt = mtime(fn); | 2769 | double mt; |
| 2770 | |||
| 2771 | while ((mt = mtime(fn)) == 0 && md5s[n] != NULL) { | ||
| 2772 | /* object is not here: move to the next one */ | ||
| 2773 | if (xs_list_next(tls[n], &md5s[n], &c[n])) { | ||
| 2774 | xs_free(fn); | ||
| 2775 | fn = _object_fn_by_md5(md5s[n], "content_search_2"); | ||
| 2776 | } | ||
| 2777 | else | ||
| 2778 | md5s[n] = NULL; | ||
| 2779 | } | ||
| 2770 | 2780 | ||
| 2771 | if (mt > mtime) { | 2781 | if (mt > mtime) { |
| 2772 | newest = n; | 2782 | newest = n; |