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

Function join_route_paths

internal/cbm/extract_defs.c:1781–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1779}
1780
1781static const char *join_route_paths(CBMArena *a, const char *prefix, const char *path) {
1782 if (!path || !path[0]) {
1783 return prefix;
1784 }
1785 if (!prefix || !prefix[0] || strcmp(prefix, "/") == 0) {
1786 return path;
1787 }
1788 if (strcmp(path, "/") == 0) {
1789 return prefix;
1790 }
1791 size_t plen = strlen(prefix);
1792 bool prefix_slash = prefix[plen - 1] == '/';
1793 bool path_slash = path[0] == '/';
1794 if (prefix_slash && path_slash) {
1795 return cbm_arena_sprintf(a, "%s%s", prefix, path + SKIP_CHAR);
1796 }
1797 if (!prefix_slash && !path_slash) {
1798 return cbm_arena_sprintf(a, "%s/%s", prefix, path);
1799 }
1800 return cbm_arena_sprintf(a, "%s%s", prefix, path);
1801}
1802
1803static const char *spring_class_route_prefix(CBMArena *a, TSNode class_node, const char *source,
1804 const CBMLangSpec *spec) {

Callers 1

push_method_defFunction · 0.85

Calls 1

cbm_arena_sprintfFunction · 0.70

Tested by

no test coverage detected