source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: In URIs in apropos(1) result tables,  only write the manpath if
@ 2017-03-15 13:50 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-03-15 13:50 UTC (permalink / raw)
  To: source

Log Message:
-----------
In URIs in apropos(1) result tables, 
only write the manpath if it does not match the default.

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

Revision Data
-------------
Index: cgi.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/cgi.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -Lcgi.c -Lcgi.c -u -p -r1.150 -r1.151
--- cgi.c
+++ cgi.c
@@ -653,9 +653,12 @@ pg_searchres(const struct req *req, stru
 		for (i = 0; i < sz; i++) {
 			printf("  <tr>\n"
 			       "    <td>"
-			       "<a class=\"Xr\" href=\"/%s%s%s/%s\">",
-			    scriptname, *scriptname == '\0' ? "" : "/",
-			    req->q.manpath, r[i].file);
+			       "<a class=\"Xr\" href=\"/");
+			if (*scriptname != '\0')
+				printf("%s/", scriptname);
+			if (strcmp(req->q.manpath, req->p[0]))
+				printf("%s/", req->q.manpath);
+			printf("%s\">", r[i].file);
 			html_print(r[i].names);
 			printf("</a></td>\n"
 			       "    <td><span class=\"Nd\">");
--
 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:[~2017-03-15 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 13:50 mdocml: In URIs in apropos(1) result tables, only write the manpath if 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).