diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-07-10 10:03:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-07-10 10:03:16 +0000 |
commit | 21691e95d746618c1451d251c73298dd7a56df52 (patch) | |
tree | c08ff5ac19bc8b19ed67f8474322b5a617969b5c /usr.bin/mandoc/cgi.c | |
parent | 8f5d0b58f3cffa5014ff718b596342847717448c (diff) |
Simplify the code and the server setup by deleting the pseudo-manpath
"mandoc" that was used for man.cgi(8) documentation and by assuming
that the apropos(1) and man.cgi(8) manuals are simply installed in
the default manpath. Even though man.cgi(8) is not installed by
default when installing OpenBSD, it is easy to copy it into the
default manpath used for man.cgi(8).
Idea found when considering a question asked by wrant dot com.
Diffstat (limited to 'usr.bin/mandoc/cgi.c')
-rw-r--r-- | usr.bin/mandoc/cgi.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c index 4b9e8da9690..f11ca893b28 100644 --- a/usr.bin/mandoc/cgi.c +++ b/usr.bin/mandoc/cgi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgi.c,v 1.72 2016/07/09 19:44:52 schwarze Exp $ */ +/* $OpenBSD: cgi.c,v 1.73 2016/07/10 10:03:15 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de> @@ -468,9 +468,6 @@ validate_manpath(const struct req *req, const char* manpath) { size_t i; - if ( ! strcmp(manpath, "mandoc")) - return 1; - for (i = 0; i < req->psz; i++) if ( ! strcmp(manpath, req->p[i])) return 1; @@ -497,9 +494,9 @@ pg_index(const struct req *req) resp_searchform(req, FOCUS_QUERY); printf("<p>\n" "This web interface is documented in the\n" - "<a href=\"/%s%smandoc/man8/man.cgi.8\">man.cgi</a>\n" + "<a href=\"/%s%sman.cgi.8\">man.cgi(8)</a>\n" "manual, and the\n" - "<a href=\"/%s%smandoc/man1/apropos.1\">apropos</a>\n" + "<a href=\"/%s%sapropos.1\">apropos(1)</a>\n" "manual explains the query syntax.\n" "</p>\n", scriptname, *scriptname == '\0' ? "" : "/", @@ -882,12 +879,7 @@ pg_show(struct req *req, const char *fullpath) free(manpath); return; } - - if (strcmp(manpath, "mandoc")) { - free(req->q.manpath); - req->q.manpath = manpath; - } else - free(manpath); + free(manpath); if ( ! validate_filename(file)) { pg_error_badrequest( |