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

Function agent_join_path

src/cli/agent_clients.c:116–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116static int agent_join_path(char *output, size_t output_size, const char *base, const char *suffix) {
117 if (!output || output_size == 0U || !base || base[0] == '\0' || !suffix || suffix[0] == '\0') {
118 return -1;
119 }
120 size_t base_len = strlen(base);
121 const char *separator = base[base_len - 1U] == '/' || base[base_len - 1U] == '\\' ? "" : "/";
122 int written = snprintf(output, output_size, "%s%s%s", base, separator, suffix);
123 return written >= 0 && (size_t)written < output_size ? 0 : -1;
124}
125
126static bool agent_path_separator(char value, bool windows) {
127 return value == '/' || (windows && value == '\\');

Callers 3

agent_rovo_safe_overrideFunction · 0.85
agent_client_marker_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected