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

Function aa_norm_path

src/ui/atlas_api.c:33–42  ·  view source on GitHub ↗

Normalize a folder path: "" and "." mean the root; strip trailing '/'. */

Source from the content-addressed store, hash-verified

31
32/* Normalize a folder path: "" and "." mean the root; strip trailing '/'. */
33static void aa_norm_path(const char *in, char *out, size_t cap) {
34 if (!in || !in[0] || strcmp(in, ".") == 0) {
35 out[0] = '\0';
36 return;
37 }
38 snprintf(out, cap, "%s", in);
39 size_t len = strlen(out);
40 while (len > 0 && out[len - 1] == '/')
41 out[--len] = '\0';
42}
43
44/* The next path component of `full` under folder `prefix` ("" = root).
45 * Returns false when `full` is not under `prefix`. `is_direct_file` is true

Callers 1

cbm_atlas_tree_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected