summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-18 16:19:11 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-18 16:19:11 +0000
commit76ef8f9092fcac04c1d3c405b5719fdb79bc5987 (patch)
tree43c5cd6d0fef20465c1557b7f75da105b5169e86
parent4e452a40810358cef4533a02ac18776e562a62aa (diff)
downloadmandoc-76ef8f9092fcac04c1d3c405b5719fdb79bc5987.tar.gz
Bugfix: use SCRIPT_NAME for .Xr hyperlinks.
Patch from <andreas at AndreasVoegele dot com>.
-rw-r--r--cgi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgi.c b/cgi.c
index e336a51d..9f73f918 100644
--- a/cgi.c
+++ b/cgi.c
@@ -839,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);