| 81 | static const char SH_ROOT[] = "\x01"; |
| 82 | |
| 83 | static bool sh_grow(void **items, int *cap, int count, size_t elem) { |
| 84 | if (count < *cap) { |
| 85 | return true; |
| 86 | } |
| 87 | int ncap = *cap ? *cap * PAIR_LEN : SH_GROW_MIN; |
| 88 | void *grown = cbm_realloc(CBM_MEM_CLASS_OTHER, *items, (size_t)ncap * elem); |
| 89 | if (!grown) { |
| 90 | return false; |
| 91 | } |
| 92 | *items = grown; |
| 93 | *cap = ncap; |
| 94 | return true; |
| 95 | } |
| 96 | |
| 97 | static const char *sh_basename(const char *p) { |
| 98 | const char *s = strrchr(p, '/'); |
no test coverage detected