| 187 | } |
| 188 | |
| 189 | static 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". */ |
no test coverage detected