mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
fix(mcp): do not shadow cache_dir() in the ignore_worktrees reader
cppcheck 2.20 (the CI version) reports shadowFunction: the local cache_dir in cbm_mcp_ignore_worktrees_runtime_enabled() shadows the static cache_dir() helper in mcp.c. Rename the local to store_dir; no behavior change. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
1 parent
1976986f4b
commit
141b25af7b
1 file changed
+4
-4
+4
-4
@@ -21589,18 +21589,18 @@ bool cbm_mcp_ignore_worktrees_runtime_enabled(const cbm_mcp_server_t *srv) {
|
||||
if (srv && srv->config) {
|
||||
return cbm_mcp_ignore_worktrees_enabled(srv);
|
||||
}
|
||||
const char *cache_dir = cbm_resolve_cache_dir();
|
||||
if (!cache_dir) {
|
||||
const char *store_dir = cbm_resolve_cache_dir();
|
||||
if (!store_dir) {
|
||||
return false;
|
||||
}
|
||||
char store_path[CBM_SZ_4K];
|
||||
int written = snprintf(store_path, sizeof(store_path), "%s/" CBM_CONFIG_DB_FILENAME, cache_dir);
|
||||
int written = snprintf(store_path, sizeof(store_path), "%s/" CBM_CONFIG_DB_FILENAME, store_dir);
|
||||
cbm_path_info_t info;
|
||||
if (written < 0 || (size_t)written >= sizeof(store_path) ||
|
||||
cbm_path_info_utf8(store_path, &info) != CBM_PATH_INFO_OK || !info.is_regular) {
|
||||
return false;
|
||||
}
|
||||
cbm_config_t *config = cbm_config_open(cache_dir);
|
||||
cbm_config_t *config = cbm_config_open(store_dir);
|
||||
bool enabled = config && cbm_config_get_bool(config, CBM_CONFIG_IGNORE_WORKTREES, false);
|
||||
cbm_config_close(config);
|
||||
return enabled;
|
||||
|
||||
Reference in new issue
Block a user