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

Function text_parent_directory

src/cli/config_text_edit.c:502–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501#ifndef _WIN32
502static char *text_parent_directory(const char *path) {
503 const char *separator = strrchr(path, '/');
504 if (!separator) {
505 return cbm_strdup(".");
506 }
507 if (separator == path) {
508 return cbm_strdup("/");
509 }
510 return cbm_strndup(path, (size_t)(separator - path));
511}
512#endif
513
514static 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