tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* cgi.c does not add script name to links in manual pages
@ 2017-02-28  7:51 Andreas Vögele
  2017-03-18 16:23 ` Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Vögele @ 2017-02-28  7:51 UTC (permalink / raw)
  To: tech

[-- Attachment #1: Type: text/plain, Size: 266 bytes --]

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

[-- Attachment #2: cgi_c_href.diff --]
[-- Type: text/x-patch, Size: 503 bytes --]

--- 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-18 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28  7:51 cgi.c does not add script name to links in manual pages Andreas Vögele
2017-03-18 16:23 ` Ingo Schwarze

tech@mandoc.bsd.lv

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mandoc-tech

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mandoc-tech mandoc-tech/ http://inbox.vuxu.org/mandoc-tech \
		tech@mandoc.bsd.lv
	public-inbox-index mandoc-tech

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.tech


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git