/* ui-shared.c: common web output functions
*
- * Copyright (C) 2006 Lars Hjemli
+ * Copyright (C) 2006-2014 cgit Development Team <cgit@lists.zx2c4.com>
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
/* 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] != '/')