The repository dir a chart load's unknown root stood for: the matched * chart directory without the tail. */
| 1790 | /* The repository dir a chart load's unknown root stood for: the matched |
| 1791 | * chart directory without the tail. */ |
| 1792 | static void gc_root_dir(const char *chart, const char *tail, char *out, size_t out_sz) { |
| 1793 | while (tail[0] == '.' && tail[SKIP_ONE] == '/') { |
| 1794 | tail += PAIR_LEN; |
| 1795 | } |
| 1796 | while (*tail == '/') { |
| 1797 | tail++; |
| 1798 | } |
| 1799 | size_t cl = strlen(chart); |
| 1800 | size_t tl = strlen(tail); |
| 1801 | while (tl && tail[tl - SKIP_ONE] == '/') { |
| 1802 | tl--; |
| 1803 | } |
| 1804 | size_t rl = cl > tl ? cl - tl - SKIP_ONE : 0; |
| 1805 | snprintf(out, out_sz, "%.*s", (int)rl, chart); |
| 1806 | } |
| 1807 | |
| 1808 | static const char GC_CONFLICT[] = "\x01"; |
| 1809 |