From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 854d51ac for ; Sat, 18 Mar 2017 11:23:37 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1cpH8i-0002AU-1W; Sat, 18 Mar 2017 17:23:37 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1cpH8h-0004hS-QJ; Sat, 18 Mar 2017 17:23:35 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1cpH8h-0008Dj-MK; Sat, 18 Mar 2017 17:23:35 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 0fc0caf4; Sat, 18 Mar 2017 17:23:35 +0100 (CET) Date: Sat, 18 Mar 2017 17:23:35 +0100 From: Ingo Schwarze To: Andreas Voegele Cc: tech@mdocml.bsd.lv Subject: Re: cgi.c does not add script name to links in manual pages Message-ID: <20170318162335.GC52684@athene.usta.de> References: <53dc1a39-71d8-e9fb-daa1-1b3b2dd3aa66@andreasvoegele.com> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53dc1a39-71d8-e9fb-daa1-1b3b2dd3aa66@andreasvoegele.com> User-Agent: Mutt/1.6.2 (2016-07-01) Hi, Andreas Voegele wrote on Tue, Feb 28, 2017 at 08:51:02AM +0100: > attached is a patch that adds the script name to links in manual pages. > > Without the patch links point to "http://www.example.org/apropos.1" > instead of "http://www.example.org/cgi-bin/man.cgi/apropos.1" even > if the script name is not empty. Committed. Thanks for the patch! Ingo Log Message: ----------- Bugfix: use SCRIPT_NAME for .Xr hyperlinks. Patch from . Modified Files: -------------- mdocml: cgi.c Revision Data ------------- Index: cgi.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/cgi.c,v retrieving revision 1.151 retrieving revision 1.152 diff -Lcgi.c -Lcgi.c -u -p -r1.151 -r1.152 --- cgi.c +++ cgi.c @@ -839,7 +839,8 @@ resp_format(const struct req *req, const 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); -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv