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

Function join_route_paths

internal/cbm/extract_defs.c:1681–1701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1679}
1680
1681static const char *join_route_paths(CBMArena *a, const char *prefix, const char *path) {
1682 if (!path || !path[0]) {
1683 return prefix;
1684 }
1685 if (!prefix || !prefix[0] || strcmp(prefix, "/") == 0) {
1686 return path;
1687 }
1688 if (strcmp(path, "/") == 0) {
1689 return prefix;
1690 }
1691 size_t plen = strlen(prefix);
1692 bool prefix_slash = prefix[plen - 1] == '/';
1693 bool path_slash = path[0] == '/';
1694 if (prefix_slash && path_slash) {
1695 return cbm_arena_sprintf(a, "%s%s", prefix, path + SKIP_CHAR);
1696 }
1697 if (!prefix_slash && !path_slash) {
1698 return cbm_arena_sprintf(a, "%s/%s", prefix, path);
1699 }
1700 return cbm_arena_sprintf(a, "%s%s", prefix, path);
1701}
1702
1703static const char *spring_class_route_prefix(CBMArena *a, TSNode class_node, const char *source,
1704 const CBMLangSpec *spec) {

Callers 1

push_method_defFunction · 0.85

Calls 1

cbm_arena_sprintfFunction · 0.70

Tested by

no test coverage detected