From 4c2e6a534c31f69cc3ff5bf8348cee02c95a637a Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 7 Dec 2011 15:12:34 +0000 Subject: Accept old-school man.cgi parameters like "sektion" and "query". This still needs work because specifying an arch with "arch=i386" will return results that don't have an arch specified. I think this is weird, but it will need to be supported if we want backwards compatibility. --- cgi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cgi.c b/cgi.c index d3f523b5..bed8fb2d 100644 --- a/cgi.c +++ b/cgi.c @@ -323,11 +323,18 @@ resp_searchform(const struct req *req) for (i = 0; i < (int)req->fieldsz; i++) if (0 == strcmp(req->fields[i].key, "expr")) expr = req->fields[i].val; + else if (0 == strcmp(req->fields[i].key, "query")) + expr = req->fields[i].val; else if (0 == strcmp(req->fields[i].key, "sec")) sec = req->fields[i].val; + else if (0 == strcmp(req->fields[i].key, "sektion")) + sec = req->fields[i].val; else if (0 == strcmp(req->fields[i].key, "arch")) arch = req->fields[i].val; + if (NULL != sec && 0 == strcmp(sec, "0")) + sec = NULL; + puts(""); printf("
fieldsz; i++) if (0 == strcmp(req->fields[i].key, "expr")) ep = req->fields[i].val; + else if (0 == strcmp(req->fields[i].key, "query")) + ep = req->fields[i].val; else if (0 == strcmp(req->fields[i].key, "sec")) opt.cat = req->fields[i].val; + else if (0 == strcmp(req->fields[i].key, "sektion")) + opt.cat = req->fields[i].val; else if (0 == strcmp(req->fields[i].key, "arch")) opt.arch = req->fields[i].val; + else if (0 == strcmp(req->fields[i].key, "apropos")) + whatis = 0 == strcmp + (req->fields[i].val, "0"); else if (0 == strcmp(req->fields[i].key, "op")) whatis = 0 == strcasecmp (req->fields[i].val, "whatis"); + if (NULL != opt.cat && 0 == strcmp(opt.cat, "0")) + opt.cat = NULL; + /* * Poor man's tokenisation. * Just break apart by spaces. -- cgit