| 58 | } |
| 59 | |
| 60 | char *cbm_path_join_n(CBMArena *a, const char **parts, int n) { |
| 61 | if (n <= 0 || !parts) { |
| 62 | return cbm_arena_strdup(a, ""); |
| 63 | } |
| 64 | if (n == SKIP_ONE) { |
| 65 | return cbm_arena_strdup(a, parts[0]); |
| 66 | } |
| 67 | |
| 68 | char *result = cbm_arena_strdup(a, parts[0]); |
| 69 | for (int i = SKIP_ONE; i < n; i++) { |
| 70 | result = cbm_path_join(a, result, parts[i]); |
| 71 | } |
| 72 | return result; |
| 73 | } |
| 74 | |
| 75 | const char *cbm_path_ext(const char *path) { |
| 76 | if (!path) { |
no test coverage detected