MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_env_home_dir

Function cbm_env_home_dir

src/cli/cli.c:2426–2438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2424}
2425
2426static void cbm_env_home_dir(const char *env_name, const char *home_dir, const char *fallback,
2427 char *out, size_t out_sz) {
2428 char env_buf[CLI_BUF_1K];
2429 const char *custom = cbm_safe_getenv(env_name, env_buf, sizeof(env_buf), NULL);
2430 out[0] = '\0';
2431 if (custom && custom[0] && cbm_expand_user_path(home_dir, custom, out, out_sz)) {
2432 return;
2433 }
2434 int written = snprintf(out, out_sz, "%s/%s", home_dir, fallback);
2435 if (written < 0 || (size_t)written >= out_sz) {
2436 out[0] = '\0';
2437 }
2438}
2439
2440static void cbm_kiro_home_dir(const char *home_dir, char *out, size_t out_sz) {
2441 cbm_env_home_dir("KIRO_HOME", home_dir, ".kiro", out, out_sz);

Callers 4

cbm_kiro_home_dirFunction · 0.85
cbm_hermes_home_dirFunction · 0.85
cbm_qwen_home_dirFunction · 0.85
cbm_cline_data_dirFunction · 0.85

Calls 2

cbm_safe_getenvFunction · 0.85
cbm_expand_user_pathFunction · 0.85

Tested by

no test coverage detected