version 1.86, 2014/07/25 17:34:06 |
version 1.88, 2014/07/25 18:20:39 |
|
|
http_printquery(const struct req *req) |
http_printquery(const struct req *req) |
{ |
{ |
|
|
if (NULL != req->q.manpath) { |
if (NULL != req->q.query) { |
printf("&manpath="); |
printf("query="); |
http_print(req->q.manpath); |
http_print(req->q.query); |
} |
} |
|
if (0 == req->q.equal) |
|
printf("&apropos=1"); |
if (NULL != req->q.sec) { |
if (NULL != req->q.sec) { |
printf("&sec="); |
printf("&sec="); |
http_print(req->q.sec); |
http_print(req->q.sec); |
Line 160 http_printquery(const struct req *req) |
|
Line 162 http_printquery(const struct req *req) |
|
printf("&arch="); |
printf("&arch="); |
http_print(req->q.arch); |
http_print(req->q.arch); |
} |
} |
if (NULL != req->q.query) { |
if (NULL != req->q.manpath && |
printf("&query="); |
strcmp(req->q.manpath, req->p[0])) { |
http_print(req->q.query); |
printf("&manpath="); |
|
http_print(req->q.manpath); |
} |
} |
if (0 == req->q.equal) |
|
printf("&apropos=1"); |
|
} |
} |
|
|
static void |
static void |
html_printquery(const struct req *req) |
html_printquery(const struct req *req) |
{ |
{ |
|
|
if (NULL != req->q.manpath) { |
if (NULL != req->q.query) { |
printf("&manpath="); |
printf("query="); |
html_print(req->q.manpath); |
html_print(req->q.query); |
} |
} |
|
if (0 == req->q.equal) |
|
printf("&apropos=1"); |
if (NULL != req->q.sec) { |
if (NULL != req->q.sec) { |
printf("&sec="); |
printf("&sec="); |
html_print(req->q.sec); |
html_print(req->q.sec); |
Line 184 html_printquery(const struct req *req) |
|
Line 187 html_printquery(const struct req *req) |
|
printf("&arch="); |
printf("&arch="); |
html_print(req->q.arch); |
html_print(req->q.arch); |
} |
} |
if (NULL != req->q.query) { |
if (NULL != req->q.manpath && |
printf("&query="); |
strcmp(req->q.manpath, req->p[0])) { |
html_print(req->q.query); |
printf("&manpath="); |
|
html_print(req->q.manpath); |
} |
} |
if (0 == req->q.equal) |
|
printf("&apropos=1"); |
|
} |
} |
|
|
static void |
static void |
Line 874 format(const struct req *req, const char *file) |
|
Line 876 format(const struct req *req, const char *file) |
|
} |
} |
|
|
snprintf(opts, sizeof(opts), "fragment,man=%s?" |
snprintf(opts, sizeof(opts), "fragment,man=%s?" |
"manpath=%s&query=%%N&sec=%%S&arch=%s", |
"manpath=%s&query=%%N&sec=%%S%s%s", |
scriptname, req->q.manpath, |
scriptname, req->q.manpath, |
|
req->q.arch ? "&arch=" : "", |
req->q.arch ? req->q.arch : ""); |
req->q.arch ? req->q.arch : ""); |
|
|
mparse_result(mp, &mdoc, &man, NULL); |
mparse_result(mp, &mdoc, &man, NULL); |