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

Function text_parent_directory

src/cli/config_text_edit.c:516–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514
515#ifndef _WIN32
516static char *text_parent_directory(const char *path) {
517 const char *separator = strrchr(path, '/');
518 if (!separator) {
519 return cbm_strdup(".");
520 }
521 if (separator == path) {
522 return cbm_strdup("/");
523 }
524 return cbm_strndup(path, (size_t)(separator - path));
525}
526#endif
527
528static int text_snapshot_matches_path(const char *path, const char *expected_data,

Callers 1

Calls 1

cbm_strndupFunction · 0.85

Tested by

no test coverage detected