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

Function path_basename

src/pipeline/pass_pkgmap.c:139–142  ·  view source on GitHub ↗

Get the basename from a relative path. Returns pointer into rel_path. */

Source from the content-addressed store, hash-verified

137
138/* Get the basename from a relative path. Returns pointer into rel_path. */
139static const char *path_basename(const char *rel_path) {
140 const char *last = strrchr(rel_path, '/');
141 return last ? last + SKIP_ONE : rel_path;
142}
143
144/* Get the directory part of a relative path (without trailing slash).
145 * Returns heap-allocated string. For "foo.json" returns "". */

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected