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

Function path_join

src/discover/discover.c:201–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static void path_join(char *out, size_t out_sz, const char *base, const char *rel) {
202 if (!out || out_sz == 0) {
203 return;
204 }
205 if (!base || base[0] == '\0') {
206 snprintf(out, out_sz, "%s", rel ? rel : "");
207 } else if (!rel || rel[0] == '\0') {
208 snprintf(out, out_sz, "%s", base);
209 } else if (has_trailing_sep(base)) {
210 snprintf(out, out_sz, "%s%s", base, rel);
211 } else {
212 snprintf(out, out_sz, "%s/%s", base, rel);
213 }
214 cbm_normalize_path_sep(out);
215}
216
217static bool expand_git_path(const char *path, char *out, size_t out_sz) {
218 if (!path || !path[0] || !out || out_sz == 0) {

Callers 5

expand_git_pathFunction · 0.85
resolve_git_common_dirFunction · 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