summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/cgi.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-03-18 16:18:45 +0000
committerschwarze <schwarze@openbsd.org>2017-03-18 16:18:45 +0000
commitac2abdb8d2a6d822261deb531f274b13bd1537cd (patch)
tree2f23da795380e225b8e4cb36d6ba2468262055d9 /usr.bin/mandoc/cgi.c
parentFewer magic numbers. (diff)
downloadwireguard-openbsd-ac2abdb8d2a6d822261deb531f274b13bd1537cd.tar.xz
wireguard-openbsd-ac2abdb8d2a6d822261deb531f274b13bd1537cd.zip
Bugfix: use SCRIPT_NAME for .Xr hyperlinks.
Patch from <andreas at AndreasVoegele dot com>.
Diffstat (limited to 'usr.bin/mandoc/cgi.c')
-rw-r--r--usr.bin/mandoc/cgi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index 6b247bcf090..b9e56ee4000 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgi.c,v 1.89 2017/03/15 13:49:26 schwarze Exp $ */
+/* $OpenBSD: cgi.c,v 1.90 2017/03/18 16:18:45 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@usta.de>
@@ -835,7 +835,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);