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

Function resolve_path

src/pipeline/pass_compile_commands.c:60–78  ·  view source on GitHub ↗

Resolve a path: if relative, join with directory. */

Source from the content-addressed store, hash-verified

58
59/* Resolve a path: if relative, join with directory. */
60static char *resolve_path(const char *path, const char *directory) {
61 if (!path) {
62 return NULL;
63 }
64
65 /* Absolute path */
66 if (path[0] == '/') {
67 return strdup(path);
68 }
69
70 /* Relative — join with directory */
71 if (directory && directory[0]) {
72 char buf[CBM_SZ_4K];
73 snprintf(buf, sizeof(buf), "%s/%s", directory, path);
74 return strdup(buf);
75 }
76
77 return strdup(path);
78}
79
80/* Try to consume a -I or -isystem include path flag. Returns true if consumed. */
81static bool try_include_flag(cbm_compile_flags_t *f, const char **args, int argc, int *i,

Callers 1

try_include_flagFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected