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

Function toml_parent_directory

src/cli/config_toml_edit.c:544–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542
543#ifndef _WIN32
544static char *toml_parent_directory(const char *path) {
545 const char *separator = strrchr(path, '/');
546 if (!separator) {
547 return cbm_strdup(".");
548 }
549 if (separator == path) {
550 return cbm_strdup("/");
551 }
552 return cbm_strndup(path, (size_t)(separator - path));
553}
554#endif
555
556static int toml_snapshot_matches_path(const char *path, const char *old_data, size_t old_len,

Callers 1

Calls 1

cbm_strndupFunction · 0.85

Tested by

no test coverage detected