- slash = strrchr(ctx.repo->readme, '/');
- if (!slash) {
- if (!colon)
- return;
- slash = colon;
- }
- tmp = xmalloc(slash - ctx.repo->readme + 1 + strlen(path) + 1);
- strncpy(tmp, ctx.repo->readme, slash - ctx.repo->readme + 1);
- strcpy(tmp + (slash - ctx.repo->readme + 1), path);
- } else
- tmp = ctx.repo->readme;