From: schwarze Date: Fri, 25 Jul 2014 17:51:33 +0000 (+0000) Subject: In generated .Xr links, avoid double encoding of ampersands X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4e874bf13f5eeb6476e54071b70fb380988f43e4;p=openbsd In generated .Xr links, avoid double encoding of ampersands and avoid empty arch= keys. --- diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c index 613570c08bd..681be2b9415 100644 --- a/usr.bin/mandoc/cgi.c +++ b/usr.bin/mandoc/cgi.c @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.26 2014/07/25 17:33:51 schwarze Exp $ */ +/* $Id: cgi.c,v 1.27 2014/07/25 17:51:33 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -870,8 +870,9 @@ format(const struct req *req, const char *file) } snprintf(opts, sizeof(opts), "fragment,man=%s?" - "manpath=%s&query=%%N&sec=%%S&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);