| 210 | } |
| 211 | |
| 212 | static void path_join(char *out, size_t out_sz, const char *base, const char *rel) { |
| 213 | if (!out || out_sz == 0) { |
| 214 | return; |
| 215 | } |
| 216 | if (!base || base[0] == '\0') { |
| 217 | snprintf(out, out_sz, "%s", rel ? rel : ""); |
| 218 | } else if (!rel || rel[0] == '\0') { |
| 219 | snprintf(out, out_sz, "%s", base); |
| 220 | } else if (has_trailing_sep(base)) { |
| 221 | snprintf(out, out_sz, "%s%s", base, rel); |
| 222 | } else { |
| 223 | snprintf(out, out_sz, "%s/%s", base, rel); |
| 224 | } |
| 225 | cbm_normalize_path_sep(out); |
| 226 | } |
| 227 | |
| 228 | static bool expand_git_path(const char *path, char *out, size_t out_sz) { |
| 229 | if (!path || !path[0] || !out || out_sz == 0) { |
no test coverage detected