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

Function agent_trim_copy

src/cli/agent_clients.c:308–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308static char *agent_trim_copy(const char *start, size_t length) {
309 while (length > 0U && isspace((unsigned char)*start)) {
310 start++;
311 length--;
312 }
313 while (length > 0U && isspace((unsigned char)start[length - 1U])) {
314 length--;
315 }
316 if (length >= 2U && ((start[0] == '"' && start[length - 1U] == '"') ||
317 (start[0] == '\'' && start[length - 1U] == '\''))) {
318 start++;
319 length -= 2U;
320 }
321 char *copy = (char *)malloc(length + 1U);
322 if (!copy) {
323 return NULL;
324 }
325 memcpy(copy, start, length);
326 copy[length] = '\0';
327 return copy;
328}
329
330/* Reads only the documented `mcp.mcpConfigPath` scalar. Unsupported aliases,
331 * block scalars, duplicates, or malformed indentation fail closed. */

Callers 2

agent_rovo_overrideFunction · 0.85
agent_yaml_named_itemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected