tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Andreas Voegele <andreas@andreasvoegele.com>
Cc: tech@mdocml.bsd.lv
Subject: Re: cgi.c does not add script name to links in manual pages
Date: Sat, 18 Mar 2017 17:23:35 +0100
Message-ID: <20170318162335.GC52684@athene.usta.de> (raw)
In-Reply-To: <53dc1a39-71d8-e9fb-daa1-1b3b2dd3aa66@andreasvoegele.com>

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 <andreas at AndreasVoegele dot com>.

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

      reply	other threads:[~2017-03-18 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28  7:51 Andreas Vögele
2017-03-18 16:23 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170318162335.GC52684@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=andreas@andreasvoegele.com \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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