=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -p -r1.52 -r1.53 --- mandoc/cgi.c 2014/07/09 07:30:47 1.52 +++ mandoc/cgi.c 2014/07/09 08:53:28 1.53 @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.52 2014/07/09 07:30:47 schwarze Exp $ */ +/* $Id: cgi.c,v 1.53 2014/07/09 08:53:28 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -134,12 +134,22 @@ static void http_printquery(const struct req *req) { - printf("&expr="); - http_print(req->q.expr ? req->q.expr : ""); - printf("&sec="); - http_print(req->q.sec ? req->q.sec : ""); - printf("&arch="); - http_print(req->q.arch ? req->q.arch : ""); + if (NULL != req->q.manroot) { + printf("&manpath="); + http_print(req->q.manroot); + } + if (NULL != req->q.sec) { + printf("&sec="); + http_print(req->q.sec); + } + if (NULL != req->q.arch) { + printf("&arch="); + http_print(req->q.arch); + } + if (NULL != req->q.expr) { + printf("&expr="); + http_print(req->q.expr ? req->q.expr : ""); + } } @@ -147,12 +157,22 @@ static void html_printquery(const struct req *req) { - printf("&expr="); - html_print(req->q.expr ? req->q.expr : ""); - printf("&sec="); - html_print(req->q.sec ? req->q.sec : ""); - printf("&arch="); - html_print(req->q.arch ? req->q.arch : ""); + if (NULL != req->q.manroot) { + printf("&manpath="); + html_print(req->q.manroot); + } + if (NULL != req->q.sec) { + printf("&sec="); + html_print(req->q.sec); + } + if (NULL != req->q.arch) { + printf("&arch="); + html_print(req->q.arch); + } + if (NULL != req->q.expr) { + printf("&expr="); + html_print(req->q.expr ? req->q.expr : ""); + } } static void