| 199 | } |
| 200 | |
| 201 | static void path_join(char *out, size_t out_sz, const char *base, const char *rel) { |
| 202 | if (!out || out_sz == 0) { |
| 203 | return; |
| 204 | } |
| 205 | if (!base || base[0] == '\0') { |
| 206 | snprintf(out, out_sz, "%s", rel ? rel : ""); |
| 207 | } else if (!rel || rel[0] == '\0') { |
| 208 | snprintf(out, out_sz, "%s", base); |
| 209 | } else if (has_trailing_sep(base)) { |
| 210 | snprintf(out, out_sz, "%s%s", base, rel); |
| 211 | } else { |
| 212 | snprintf(out, out_sz, "%s/%s", base, rel); |
| 213 | } |
| 214 | cbm_normalize_path_sep(out); |
| 215 | } |
| 216 | |
| 217 | static bool expand_git_path(const char *path, char *out, size_t out_sz) { |
| 218 | if (!path || !path[0] || !out || out_sz == 0) { |
no test coverage detected