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

Function prepare_config_parent

src/cli/cli.c:7171–7190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7169}
7170
7171static bool prepare_config_parent(const char *path) {
7172 if (!path || !path[0]) {
7173 return false;
7174 }
7175 char parent[CLI_BUF_1K];
7176 int written = snprintf(parent, sizeof(parent), "%s", path);
7177 if (written < 0 || (size_t)written >= sizeof(parent)) {
7178 return false;
7179 }
7180 char *slash = strrchr(parent, '/');
7181 char *backslash = strrchr(parent, '\\');
7182 if (backslash && (!slash || backslash > slash)) {
7183 slash = backslash;
7184 }
7185 if (!slash || slash == parent) {
7186 return slash != NULL;
7187 }
7188 *slash = '\0';
7189 return cbm_mkdir_p(parent, CLI_OCTAL_PERM);
7190}
7191
7192typedef struct {
7193 const char *label;

Calls 1

cbm_mkdir_pFunction · 0.85

Tested by

no test coverage detected