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

Function cbm_env_home_dir

src/cli/cli.c:2245–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2243}
2244
2245static void cbm_env_home_dir(const char *env_name, const char *home_dir, const char *fallback,
2246 char *out, size_t out_sz) {
2247 char env_buf[CLI_BUF_1K];
2248 const char *custom = cbm_safe_getenv(env_name, env_buf, sizeof(env_buf), NULL);
2249 out[0] = '\0';
2250 if (custom && custom[0] && cbm_expand_user_path(home_dir, custom, out, out_sz)) {
2251 return;
2252 }
2253 int written = snprintf(out, out_sz, "%s/%s", home_dir, fallback);
2254 if (written < 0 || (size_t)written >= out_sz) {
2255 out[0] = '\0';
2256 }
2257}
2258
2259static void cbm_kiro_home_dir(const char *home_dir, char *out, size_t out_sz) {
2260 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