summaryrefslogtreecommitdiffstats
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-25 17:52:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-25 17:52:04 +0000
commitbef36583b65be07800ac2fa6493ee023487bff45 (patch)
treeb8667e361e35c0a02e2ae3dc53014b73d642a9c8 /cgi.c
parentcba77da50eb3d171a32e2a43937cb2edf7c79bb2 (diff)
downloadmandoc-bef36583b65be07800ac2fa6493ee023487bff45.tar.gz
In generated .Xr links, avoid double encoding of ampersands
and avoid empty arch= keys.
Diffstat (limited to 'cgi.c')
-rw-r--r--cgi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cgi.c b/cgi.c
index c3793f2e..c816852c 100644
--- a/cgi.c
+++ b/cgi.c
@@ -874,8 +874,9 @@ format(const struct req *req, const char *file)
}
snprintf(opts, sizeof(opts), "fragment,man=%s?"
- "manpath=%s&amp;query=%%N&amp;sec=%%S&amp;arch=%s",
+ "manpath=%s&query=%%N&sec=%%S%s%s",
scriptname, req->q.manpath,
+ req->q.arch ? "&arch=" : "",
req->q.arch ? req->q.arch : "");
mparse_result(mp, &mdoc, &man, NULL);