diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-17 03:24:47 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-17 03:24:47 +0000 |
commit | e88e13e117e3b7d9de27952e40bb54cc9f589074 (patch) | |
tree | a2409683c88f57d8151056a5e42519a2886d87f4 /cgi.c | |
parent | e787f86b365b1779d9ea4b2c1b4b35617a18d0ba (diff) | |
download | mandoc-e88e13e117e3b7d9de27952e40bb54cc9f589074.tar.gz |
Fully integrate apropos(1) into mandoc(1).
Switch the argmode on the progname, including man(1).
Provide -f and -k options to switch the argmode.
Store the argmode inside struct search, generalizing the flags.
Derive the deftype from the argmode when needed instead of storing it.
Store the outkey inside struct search instead of passing it alone.
While here, get rid of the trailing blanks in Makefile.depend.
Diffstat (limited to 'cgi.c')
-rw-r--r-- | cgi.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -973,8 +973,8 @@ pg_search(const struct req *req) search.arch = req->q.arch; search.sec = req->q.sec; - search.deftype = req->q.equal ? TYPE_Nm : (TYPE_Nm | TYPE_Nd); - search.flags = req->q.equal ? MANSEARCH_MAN : 0; + search.outkey = "Nd"; + search.argmode = req->q.equal ? ARG_NAME : ARG_EXPR; paths.sz = 1; paths.paths = mandoc_malloc(sizeof(char *)); @@ -1003,7 +1003,7 @@ pg_search(const struct req *req) ep++; } - if (0 == mansearch(&search, &paths, sz, cp, "Nd", &res, &ressz)) + if (0 == mansearch(&search, &paths, sz, cp, &res, &ressz)) pg_noresult(req, "You entered an invalid query."); else if (0 == ressz) pg_noresult(req, "No results found."); |