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

Function toml_parent_directory

src/cli/config_toml_edit.c:522–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520
521#ifndef _WIN32
522static char *toml_parent_directory(const char *path) {
523 const char *separator = strrchr(path, '/');
524 if (!separator) {
525 return cbm_strdup(".");
526 }
527 if (separator == path) {
528 return cbm_strdup("/");
529 }
530 return cbm_strndup(path, (size_t)(separator - path));
531}
532#endif
533
534static 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