A path glob: * and ? within a segment, segment for segment. */
| 1161 | |
| 1162 | /* A path glob: * and ? within a segment, segment for segment. */ |
| 1163 | static bool sh_glob_path(const char *pat, const char *path) { |
| 1164 | for (;;) { |
| 1165 | size_t pl = strcspn(pat, "/"); |
| 1166 | size_t tl = strcspn(path, "/"); |
| 1167 | if (!sh_glob_seg(pat, pl, path, tl)) { |
| 1168 | return false; |
| 1169 | } |
| 1170 | if (!pat[pl] || !path[tl]) { |
| 1171 | return !pat[pl] && !path[tl]; |
| 1172 | } |
| 1173 | pat += pl + SKIP_ONE; |
| 1174 | path += tl + SKIP_ONE; |
| 1175 | } |
| 1176 | } |
| 1177 | |
| 1178 | static int sh_add_manifest(sh_t *s, const char *p, sh_targets_t *out) { |
| 1179 | int64_t id = (int64_t)(intptr_t)cbm_ht_get(s->ix->file_ids, p); |
no test coverage detected