=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.150 retrieving revision 1.152 diff -u -p -r1.150 -r1.152 --- mandoc/cgi.c 2017/03/15 13:18:53 1.150 +++ mandoc/cgi.c 2017/03/18 16:19:11 1.152 @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.150 2017/03/15 13:18:53 schwarze Exp $ */ +/* $Id: cgi.c,v 1.152 2017/03/18 16:19:11 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -653,9 +653,12 @@ pg_searchres(const struct req *req, struct manpage *r, for (i = 0; i < sz; i++) { printf(" \n" " " - "", - scriptname, *scriptname == '\0' ? "" : "/", - req->q.manpath, r[i].file); + "q.manpath, req->p[0])) + printf("%s/", req->q.manpath); + printf("%s\">", r[i].file); html_print(r[i].names); printf("\n" " "); @@ -836,7 +839,8 @@ resp_format(const struct req *req, const char *file) conf.fragment = 1; conf.style = mandoc_strdup(CSS_DIR "/mandoc.css"); usepath = strcmp(req->q.manpath, req->p[0]); - mandoc_asprintf(&conf.man, "/%s%s%%N.%%S", + mandoc_asprintf(&conf.man, "/%s%s%s%s%%N.%%S", + scriptname, *scriptname == '\0' ? "" : "/", usepath ? req->q.manpath : "", usepath ? "/" : ""); mparse_result(mp, &man, NULL);