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

Function ws_first_component_matches

src/foundation/workspace.c:171–188  ·  view source on GitHub ↗

Match only the first component below the volume prefix. */

Source from the content-addressed store, hash-verified

169
170/* Match only the first component below the volume prefix. */
171static bool ws_first_component_matches(const char *path, const char *const *names, size_t count,
172 bool fold_case) {
173 const char *p = path + ws_volume_prefix_len(path);
174 while (ws_is_sep(*p)) {
175 p++;
176 }
177 const char *start = p;
178 while (*p && !ws_is_sep(*p)) {
179 p++;
180 }
181 size_t len = (size_t)(p - start);
182 for (size_t i = 0; i < count; i++) {
183 if (ws_component_equals(start, len, names[i], fold_case)) {
184 return true;
185 }
186 }
187 return false;
188}
189
190static bool ws_any_component_matches(const char *path, const char *const *names, size_t count,
191 bool fold_case) {

Callers 1

Calls 3

ws_volume_prefix_lenFunction · 0.85
ws_is_sepFunction · 0.85
ws_component_equalsFunction · 0.85

Tested by

no test coverage detected