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

Function strip_root_prefix

src/mcp/mcp.c:15201–15210  ·  view source on GitHub ↗

Read grep output from fp, parse file:line:content format, apply path filter, * and return a dynamically-allocated grep_match_t array. */ Strip root path prefix from a file path. */

Source from the content-addressed store, hash-verified

15199 * and return a dynamically-allocated grep_match_t array. */
15200/* Strip root path prefix from a file path. */
15201static const char *strip_root_prefix(const char *path, const char *root, size_t root_len) {
15202 if (strncmp(path, root, root_len) != 0) {
15203 return path;
15204 }
15205 const char *p = path + root_len;
15206 if (*p == '/') {
15207 p++;
15208 }
15209 return p;
15210}
15211
15212static bool search_match_bounds(const char *content, const char *pattern, bool use_regex,
15213 const cbm_regex_t *compiled_regex, size_t *start_out,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected