=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/cgi.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/mandoc/cgi.c 2014/07/21 15:44:22 1.18 --- src/usr.bin/mandoc/cgi.c 2014/07/21 22:32:55 1.19 *************** *** 1,4 **** ! /* $Id: cgi.c,v 1.18 2014/07/21 15:44:22 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze --- 1,4 ---- ! /* $Id: cgi.c,v 1.19 2014/07/21 22:32:55 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze *************** *** 67,73 **** 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 resp_begin_html(int, const char *); static void resp_begin_http(int, const char *); static void resp_end_html(void); --- 67,73 ---- static void pg_search(const struct req *); static void pg_searchres(const struct req *, struct manpage *, size_t); ! 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); *************** *** 781,789 **** return; } ! snprintf(opts, sizeof(opts), ! "fragment,man=%s?query=%%N&sec=%%S", ! scriptname); mparse_result(mp, &mdoc, &man, NULL); if (NULL == man && NULL == mdoc) { --- 781,790 ---- return; } ! 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) { *************** *** 819,825 **** } static void ! pg_show(const struct req *req, const char *path) { char *sub; --- 820,826 ---- } static void ! pg_show(struct req *req, const char *path) { char *sub; *************** *** 854,859 **** --- 855,863 ---- "You specified an invalid manual file."); return; } + + if (strcmp(path, "mandoc")) + req->q.manpath = path; resp_begin_html(200, NULL); resp_searchform(req);