From e88e13e117e3b7d9de27952e40bb54cc9f589074 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 17 Aug 2014 03:24:47 +0000 Subject: 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. --- cgi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cgi.c') diff --git a/cgi.c b/cgi.c index 4f8339e2..42457840 100644 --- a/cgi.c +++ b/cgi.c @@ -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."); -- cgit