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

Function prepare_config_parent

src/cli/cli.c:7529–7548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7527}
7528
7529static bool prepare_config_parent(const char *path) {
7530 if (!path || !path[0]) {
7531 return false;
7532 }
7533 char parent[CLI_BUF_1K];
7534 int written = snprintf(parent, sizeof(parent), "%s", path);
7535 if (written < 0 || (size_t)written >= sizeof(parent)) {
7536 return false;
7537 }
7538 char *slash = strrchr(parent, '/');
7539 char *backslash = strrchr(parent, '\\');
7540 if (backslash && (!slash || backslash > slash)) {
7541 slash = backslash;
7542 }
7543 if (!slash || slash == parent) {
7544 return slash != NULL;
7545 }
7546 *slash = '\0';
7547 return cbm_mkdir_p(parent, CLI_OCTAL_PERM);
7548}
7549
7550typedef struct {
7551 const char *label;

Calls 1

cbm_mkdir_pFunction · 0.85

Tested by

no test coverage detected