diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-15 13:49:50 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-15 13:49:50 +0000 |
commit | 0f790e66e278261421be6bb2b1285564f929469a (patch) | |
tree | eeb5b8ed2bf70c3c871519c6db54d669ba134aef | |
parent | 45aa7e5c566905aca26d452ba4a9467300d052ff (diff) | |
download | mandoc-0f790e66e278261421be6bb2b1285564f929469a.tar.gz |
In URIs in apropos(1) result tables,
only write the manpath if it does not match the default.
-rw-r--r-- | cgi.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -653,9 +653,12 @@ pg_searchres(const struct req *req, struct manpage *r, size_t sz) for (i = 0; i < sz; i++) { printf(" <tr>\n" " <td>" - "<a class=\"Xr\" href=\"/%s%s%s/%s\">", - scriptname, *scriptname == '\0' ? "" : "/", - req->q.manpath, r[i].file); + "<a class=\"Xr\" href=\"/"); + if (*scriptname != '\0') + printf("%s/", scriptname); + if (strcmp(req->q.manpath, req->p[0])) + printf("%s/", req->q.manpath); + printf("%s\">", r[i].file); html_print(r[i].names); printf("</a></td>\n" " <td><span class=\"Nd\">"); |