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

Function path_join

src/discover/discover.c:212–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212static void path_join(char *out, size_t out_sz, const char *base, const char *rel) {
213 if (!out || out_sz == 0) {
214 return;
215 }
216 if (!base || base[0] == '\0') {
217 snprintf(out, out_sz, "%s", rel ? rel : "");
218 } else if (!rel || rel[0] == '\0') {
219 snprintf(out, out_sz, "%s", base);
220 } else if (has_trailing_sep(base)) {
221 snprintf(out, out_sz, "%s%s", base, rel);
222 } else {
223 snprintf(out, out_sz, "%s/%s", base, rel);
224 }
225 cbm_normalize_path_sep(out);
226}
227
228static bool expand_git_path(const char *path, char *out, size_t out_sz) {
229 if (!path || !path[0] || !out || out_sz == 0) {

Callers 6

expand_git_pathFunction · 0.85
resolve_git_common_dirFunction · 0.85
ancestor_ignores_buildFunction · 0.85
discover_implFunction · 0.85

Calls 2

has_trailing_sepFunction · 0.85
cbm_normalize_path_sepFunction · 0.85

Tested by

no test coverage detected