diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-09 08:53:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-09 08:53:28 +0000 |
commit | 23a18e51d6be043e909d2538c8c720ccd7780ca8 (patch) | |
tree | f7e4f364ac32700b6f2314ee45f8a2cc967d9939 /cgi.c | |
parent | 4f4fcd43d21d85de72131727bce600371434c3e0 (diff) | |
download | mandoc-23a18e51d6be043e909d2538c8c720ccd7780ca8.tar.gz |
include manpath= when printing queries, and omit empty parameters
Diffstat (limited to 'cgi.c')
-rw-r--r-- | cgi.c | 44 |
1 files changed, 32 insertions, 12 deletions
@@ -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 |