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

Function prepare_config_parent

src/cli/cli.c:7121–7140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7119}
7120
7121static bool prepare_config_parent(const char *path) {
7122 if (!path || !path[0]) {
7123 return false;
7124 }
7125 char parent[CLI_BUF_1K];
7126 int written = snprintf(parent, sizeof(parent), "%s", path);
7127 if (written < 0 || (size_t)written >= sizeof(parent)) {
7128 return false;
7129 }
7130 char *slash = strrchr(parent, '/');
7131 char *backslash = strrchr(parent, '\\');
7132 if (backslash && (!slash || backslash > slash)) {
7133 slash = backslash;
7134 }
7135 if (!slash || slash == parent) {
7136 return slash != NULL;
7137 }
7138 *slash = '\0';
7139 return cbm_mkdir_p(parent, CLI_OCTAL_PERM);
7140}
7141
7142typedef struct {
7143 const char *label;

Calls 1

cbm_mkdir_pFunction · 0.85

Tested by

no test coverage detected