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

Function ws_any_component_matches

src/foundation/workspace.c:189–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189static bool ws_any_component_matches(const char *path, const char *const *names, size_t count,
190 bool fold_case) {
191 size_t prefix = ws_volume_prefix_len(path);
192 const char *p = path + prefix;
193 while (*p) {
194 while (ws_is_sep(*p)) {
195 p++;
196 }
197 if (!*p) {
198 break;
199 }
200 const char *start = p;
201 while (*p && !ws_is_sep(*p)) {
202 p++;
203 }
204 size_t len = (size_t)(p - start);
205 for (size_t i = 0; i < count; i++) {
206 if (ws_component_equals(start, len, names[i], fold_case)) {
207 return true;
208 }
209 }
210 }
211 return false;
212}
213
214/* True when b is a or lives under a. Compares on a separator boundary so
215 * "/a/bc" is not treated as living under "/a/b". */

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