| 402 | /* ── Cache directory ────────────────────────── */ |
| 403 | |
| 404 | const char *cbm_resolve_cache_dir(void) { |
| 405 | static char buf[CBM_SZ_1K]; |
| 406 | char tmp[CBM_SZ_256] = ""; |
| 407 | cbm_safe_getenv("CBM_CACHE_DIR", tmp, sizeof(tmp), NULL); |
| 408 | if (tmp[0]) { |
| 409 | snprintf(buf, sizeof(buf), "%s", tmp); |
| 410 | cbm_normalize_path_sep(buf); |
| 411 | return buf; |
| 412 | } |
| 413 | const char *home = cbm_get_home_dir(); |
| 414 | if (!home) { |
| 415 | return NULL; |
| 416 | } |
| 417 | snprintf(buf, sizeof(buf), "%s/.cache/codebase-memory-mcp", home); |
| 418 | return buf; |
| 419 | } |
no test coverage detected