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

Function sh_glob_path

src/pipeline/pass_shell.c:1163–1176  ·  view source on GitHub ↗

A path glob: * and ? within a segment, segment for segment. */

Source from the content-addressed store, hash-verified

1161
1162/* A path glob: * and ? within a segment, segment for segment. */
1163static bool sh_glob_path(const char *pat, const char *path) {
1164 for (;;) {
1165 size_t pl = strcspn(pat, "/");
1166 size_t tl = strcspn(path, "/");
1167 if (!sh_glob_seg(pat, pl, path, tl)) {
1168 return false;
1169 }
1170 if (!pat[pl] || !path[tl]) {
1171 return !pat[pl] && !path[tl];
1172 }
1173 pat += pl + SKIP_ONE;
1174 path += tl + SKIP_ONE;
1175 }
1176}
1177
1178static int sh_add_manifest(sh_t *s, const char *p, sh_targets_t *out) {
1179 int64_t id = (int64_t)(intptr_t)cbm_ht_get(s->ix->file_ids, p);

Callers 1

sh_t_filesFunction · 0.85

Calls 1

sh_glob_segFunction · 0.85

Tested by

no test coverage detected