source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: fix a minibug reported by kristaps@: preserve manpath and arch
@ 2014-07-21 22:33 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-07-21 22:33 UTC (permalink / raw)
  To: source

Log Message:
-----------
fix a minibug reported by kristaps@:
preserve manpath and arch in .Xr links

Modified Files:
--------------
    mdocml:
        cgi.c

Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/cgi.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -Lcgi.c -Lcgi.c -u -p -r1.78 -r1.79
--- cgi.c
+++ cgi.c
@@ -71,7 +71,7 @@ static	void		 pg_noresult(const struct r
 static	void		 pg_search(const struct req *);
 static	void		 pg_searchres(const struct req *,
 				struct manpage *, size_t);
-static	void		 pg_show(const struct req *, const char *);
+static	void		 pg_show(struct req *, const char *);
 static	void		 resp_begin_html(int, const char *);
 static	void		 resp_begin_http(int, const char *);
 static	void		 resp_end_html(void);
@@ -785,9 +785,10 @@ format(const struct req *req, const char
 		return;
 	}
 
-	snprintf(opts, sizeof(opts),
-	    "fragment,man=%s?query=%%N&sec=%%S",
-	    scriptname);
+	snprintf(opts, sizeof(opts), "fragment,man=%s?"
+	    "manpath=%s&query=%%N&sec=%%S&arch=%s",
+	    scriptname, req->q.manpath,
+	    req->q.arch ? req->q.arch : "");
 
 	mparse_result(mp, &mdoc, &man, NULL);
 	if (NULL == man && NULL == mdoc) {
@@ -823,7 +824,7 @@ resp_show(const struct req *req, const c
 }
 
 static void
-pg_show(const struct req *req, const char *path)
+pg_show(struct req *req, const char *path)
 {
 	char		*sub;
 
@@ -858,6 +859,9 @@ pg_show(const struct req *req, const cha
 		    "You specified an invalid manual file.");
 		return;
 	}
+
+	if (strcmp(path, "mandoc"))
+		req->q.manpath = path;
 
 	resp_begin_html(200, NULL);
 	resp_searchform(req);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-21 22:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21 22:33 mdocml: fix a minibug reported by kristaps@: preserve manpath and arch schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).