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

Function cbm_env_home_dir

src/cli/cli.c:2767–2779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2765}
2766
2767static void cbm_env_home_dir(const char *env_name, const char *home_dir, const char *fallback,
2768 char *out, size_t out_sz) {
2769 char env_buf[CLI_BUF_1K];
2770 const char *custom = cbm_safe_getenv(env_name, env_buf, sizeof(env_buf), NULL);
2771 out[0] = '\0';
2772 if (custom && custom[0] && cbm_expand_user_path(home_dir, custom, out, out_sz)) {
2773 return;
2774 }
2775 int written = snprintf(out, out_sz, "%s/%s", home_dir, fallback);
2776 if (written < 0 || (size_t)written >= out_sz) {
2777 out[0] = '\0';
2778 }
2779}
2780
2781static void cbm_kiro_home_dir(const char *home_dir, char *out, size_t out_sz) {
2782 cbm_env_home_dir("KIRO_HOME", home_dir, ".kiro", out, out_sz);

Callers 4

cbm_kiro_home_dirFunction · 0.85
cbm_hermes_home_dir_forFunction · 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