The one project DB in a private cache (not _config.db or activity.db), so * the test does not depend on how the server canonicalized the repo path. */
| 15307 | /* The one project DB in a private cache (not _config.db or activity.db), so |
| 15308 | * the test does not depend on how the server canonicalized the repo path. */ |
| 15309 | static bool doccand_project_db(const char *cache, char *out, size_t out_size) { |
| 15310 | cbm_dir_t *d = cbm_opendir(cache); |
| 15311 | if (!d) { |
| 15312 | return false; |
| 15313 | } |
| 15314 | bool found = false; |
| 15315 | cbm_dirent_t *e; |
| 15316 | while (!found && (e = cbm_readdir(d)) != NULL) { |
| 15317 | size_t len = strlen(e->name); |
| 15318 | if (!e->is_dir && len > 3 && strcmp(e->name + len - 3, ".db") == 0 && |
| 15319 | strcmp(e->name, "_config.db") != 0 && strcmp(e->name, "activity.db") != 0) { |
| 15320 | snprintf(out, out_size, "%s/%s", cache, e->name); |
| 15321 | found = true; |
| 15322 | } |
| 15323 | } |
| 15324 | cbm_closedir(d); |
| 15325 | return found; |
| 15326 | } |
| 15327 | |
| 15328 | /* Remove the project DB (and its WAL/SHM) so the next index is a full one. */ |
| 15329 | static void doccand_clear(const char *cache) { |
no test coverage detected