| 653 | } op_strs_t; |
| 654 | |
| 655 | static void op_strs_push(op_strs_t *v, const char *s) { |
| 656 | if (v->count == v->cap) { |
| 657 | int cap = v->cap ? v->cap * PAIR_LEN : OP_GROW_MIN; |
| 658 | char **grown = cbm_realloc(CBM_MEM_CLASS_OTHER, v->items, (size_t)cap * sizeof(*grown)); |
| 659 | if (!grown) { |
| 660 | return; |
| 661 | } |
| 662 | v->items = grown; |
| 663 | v->cap = cap; |
| 664 | } |
| 665 | char *copy = cbm_mem_strdup(CBM_MEM_CLASS_OTHER, s); |
| 666 | if (copy) { |
| 667 | v->items[v->count++] = copy; |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | /* group -> the package directories that declare it (owned keys and lists); |
| 672 | * `seen` holds "group\x1fdir" (owned keys) so a repeat is one lookup. */ |
no test coverage detected