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

Function cbm_path_within_root

src/mcp/mcp.c:8322–8335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8320}
8321
8322bool cbm_path_within_root(const char *root_path, const char *abs_path) {
8323 if (!root_path || !abs_path) {
8324 return false;
8325 }
8326 char real_root[CBM_SZ_4K];
8327 char real_file[CBM_SZ_4K];
8328 if (resolve_canonical_path(root_path, real_root, sizeof(real_root)) &&
8329 resolve_canonical_path(abs_path, real_file, sizeof(real_file))) {
8330 if (canonical_path_has_root(real_root, real_file)) {
8331 return true;
8332 }
8333 }
8334 return false;
8335}
8336
8337static char *resolve_snippet_source(const char *root_path, const char *file_path, int start,
8338 int end, char **out_abs_path) {

Callers 7

coverage_path_freshnessFunction · 0.85
resolve_snippet_sourceFunction · 0.85
attach_result_sourceFunction · 0.85
ws_match_visitFunction · 0.85
test_mcp.cFile · 0.85

Calls 2

resolve_canonical_pathFunction · 0.85
canonical_path_has_rootFunction · 0.85

Tested by

no test coverage detected