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

Function join_route_paths

internal/cbm/extract_defs.c:3565–3585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3563}
3564
3565static const char *join_route_paths(CBMArena *a, const char *prefix, const char *path) {
3566 if (!path || !path[0]) {
3567 return prefix;
3568 }
3569 if (!prefix || !prefix[0] || strcmp(prefix, "/") == 0) {
3570 return path;
3571 }
3572 if (strcmp(path, "/") == 0) {
3573 return prefix;
3574 }
3575 size_t plen = strlen(prefix);
3576 bool prefix_slash = prefix[plen - 1] == '/';
3577 bool path_slash = path[0] == '/';
3578 if (prefix_slash && path_slash) {
3579 return cbm_arena_sprintf(a, "%s%s", prefix, path + SKIP_CHAR);
3580 }
3581 if (!prefix_slash && !path_slash) {
3582 return cbm_arena_sprintf(a, "%s/%s", prefix, path);
3583 }
3584 return cbm_arena_sprintf(a, "%s%s", prefix, path);
3585}
3586
3587static const char *spring_class_route_prefix(CBMArena *a, TSNode class_node, const char *source,
3588 const CBMLangSpec *spec) {

Callers 1

push_method_defFunction · 0.85

Calls 1

cbm_arena_sprintfFunction · 0.70

Tested by

no test coverage detected