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

Function prepare_config_parent

src/cli/cli.c:7227–7246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7225}
7226
7227static bool prepare_config_parent(const char *path) {
7228 if (!path || !path[0]) {
7229 return false;
7230 }
7231 char parent[CLI_BUF_1K];
7232 int written = snprintf(parent, sizeof(parent), "%s", path);
7233 if (written < 0 || (size_t)written >= sizeof(parent)) {
7234 return false;
7235 }
7236 char *slash = strrchr(parent, '/');
7237 char *backslash = strrchr(parent, '\\');
7238 if (backslash && (!slash || backslash > slash)) {
7239 slash = backslash;
7240 }
7241 if (!slash || slash == parent) {
7242 return slash != NULL;
7243 }
7244 *slash = '\0';
7245 return cbm_mkdir_p(parent, CLI_OCTAL_PERM);
7246}
7247
7248typedef struct {
7249 const char *label;

Calls 1

cbm_mkdir_pFunction · 0.85

Tested by

no test coverage detected