From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from www.andreasvoegele.com (www.andreasvoegele.com [176.9.54.163]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id da78ec77 for ; Tue, 28 Feb 2017 02:51:08 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=andreasvoegele.com; s=july2016; h=Content-Type:MIME-Version:Date:Message-ID :To:Subject:From:Cc:Reply-To:References:In-Reply-To:Content-Transfer-Encoding ; bh=kt3LrKD6Za9687GwA50ptmHkNMjTaZ5hTdCQAjx5Aas=; b=GU0XbbFcQ/Jdv4aVxtVIXnyD eRoqpgsOr171/21VbzNG93zixgpOCZ9A7wI6VnhK2JXLzCVg+1Lzz5uazYgT/RUMepuKgRek9JweB hHfM+u7+QjKpWe1XpgzjHobpGmCCxfQIvEoNn8JLuTmsguUPV57oHHL2xJCJ9pfSVoCDYg=; Received: from p2003006a69499b011c261aa3d834ab87.dip0.t-ipconnect.de ([2003:6a:6949:9b01:1c26:1aa3:d834:ab87]) by www.andreasvoegele.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_RC6) (envelope-from ) id 1cicYo-0003zo-Sh for tech@mdocml.bsd.lv; Tue, 28 Feb 2017 08:51:02 +0100 From: =?UTF-8?Q?Andreas_V=c3=b6gele?= Subject: cgi.c does not add script name to links in manual pages To: tech@mdocml.bsd.lv Message-ID: <53dc1a39-71d8-e9fb-daa1-1b3b2dd3aa66@andreasvoegele.com> Date: Tue, 28 Feb 2017 08:51:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------952E5C0073B643D28333BFA8" This is a multi-part message in MIME format. --------------952E5C0073B643D28333BFA8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, 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. Regards, Andreas --------------952E5C0073B643D28333BFA8 Content-Type: text/x-patch; name="cgi_c_href.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cgi_c_href.diff" --- mdocml-1.14.1/cgi.c.orig 2017-02-21 01:25:20.000000000 +0100 +++ mdocml-1.14.1/cgi.c 2017-02-25 18:33:31.760281123 +0100 @@ -803,7 +803,8 @@ 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); --------------952E5C0073B643D28333BFA8-- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv