| 440 | } |
| 441 | |
| 442 | static bool application_regular_db_exists(const char *project) { |
| 443 | const char *cache = cbm_resolve_cache_dir(); |
| 444 | if (!cache || !project || !project[0]) { |
| 445 | return false; |
| 446 | } |
| 447 | char path[APPLICATION_PATH_CAP]; |
| 448 | int written = snprintf(path, sizeof(path), "%s/%s.db", cache, project); |
| 449 | if (written <= 0 || (size_t)written >= sizeof(path)) { |
| 450 | return false; |
| 451 | } |
| 452 | struct stat status; |
| 453 | return stat(path, &status) == 0 && S_ISREG(status.st_mode); |
| 454 | } |
| 455 | |
| 456 | static bool application_canonical_directory_exists(const char *path) { |
| 457 | cbm_path_info_t info = {0}; |
no test coverage detected