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

Function ws_first_component_matches

src/foundation/workspace.c:170–187  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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