Match only the first component below the volume prefix. */
| 168 | |
| 169 | /* Match only the first component below the volume prefix. */ |
| 170 | static 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 | |
| 189 | static bool ws_any_component_matches(const char *path, const char *const *names, size_t count, |
| 190 | bool fold_case) { |
no test coverage detected