/* strip trailing slashes */
while (p && rvbuf[p] == '/') rvbuf[p--] = 0;
/* strip trailing .git */
- if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) {
+ if (p >= 3 && !prefixcmp(&rvbuf[p-3], ".git")) {
p -= 3; rvbuf[p--] = 0;
}
/* strip more trailing slashes if any */
if (ctx.cfg.virtual_root)
html_attr(ctx.cfg.virtual_root);
else
- html(ctx.cfg.script_name);
+ html_url_path(ctx.cfg.script_name);
if (page) {
htmlf("?p=%s", page);
html_url_path(path);
}
} else {
- html(ctx.cfg.script_name);
+ html_url_path(ctx.cfg.script_name);
html("?url=");
html_url_arg(ctx.repo->url);
if (ctx.repo->url[strlen(ctx.repo->url) - 1] != '/')