version 1.121, 2016/04/14 20:40:33 |
version 1.123, 2016/04/15 00:14:17 |
Line 588 pg_searchres(const struct req *req, struct manpage *r, |
|
Line 588 pg_searchres(const struct req *req, struct manpage *r, |
|
|
|
resp_begin_html(200, NULL); |
resp_begin_html(200, NULL); |
resp_searchform(req); |
resp_searchform(req); |
puts("<DIV CLASS=\"results\">"); |
|
puts("<TABLE>"); |
|
|
|
for (i = 0; i < sz; i++) { |
if (sz > 1) { |
printf("<TR>\n" |
puts("<DIV CLASS=\"results\">"); |
"<TD CLASS=\"title\">\n" |
puts("<TABLE>"); |
"<A HREF=\"/%s%s%s/%s", |
|
scriptname, *scriptname == '\0' ? "" : "/", |
|
req->q.manpath, r[i].file); |
|
printf("\">"); |
|
html_print(r[i].names); |
|
printf("</A>\n" |
|
"</TD>\n" |
|
"<TD CLASS=\"desc\">"); |
|
html_print(r[i].output); |
|
puts("</TD>\n" |
|
"</TR>"); |
|
} |
|
|
|
puts("</TABLE>\n" |
for (i = 0; i < sz; i++) { |
"</DIV>"); |
printf("<TR>\n" |
|
"<TD CLASS=\"title\">\n" |
|
"<A HREF=\"/%s%s%s/%s", |
|
scriptname, *scriptname == '\0' ? "" : "/", |
|
req->q.manpath, r[i].file); |
|
printf("\">"); |
|
html_print(r[i].names); |
|
printf("</A>\n" |
|
"</TD>\n" |
|
"<TD CLASS=\"desc\">"); |
|
html_print(r[i].output); |
|
puts("</TD>\n" |
|
"</TR>"); |
|
} |
|
|
|
puts("</TABLE>\n" |
|
"</DIV>"); |
|
} |
|
|
/* |
/* |
* In man(1) mode, show one of the pages |
* In man(1) mode, show one of the pages |
* even if more than one is found. |
* even if more than one is found. |
*/ |
*/ |
|
|
if (req->q.equal) { |
if (req->q.equal || sz == 1) { |
puts("<HR>"); |
puts("<HR>"); |
iuse = 0; |
iuse = 0; |
priouse = 20; |
priouse = 20; |
Line 816 format(const struct req *req, const char *file) |
|
Line 819 format(const struct req *req, const char *file) |
|
memset(&conf, 0, sizeof(conf)); |
memset(&conf, 0, sizeof(conf)); |
conf.fragment = 1; |
conf.fragment = 1; |
usepath = strcmp(req->q.manpath, req->p[0]); |
usepath = strcmp(req->q.manpath, req->p[0]); |
mandoc_asprintf(&conf.man, "/%s?query=%%N&sec=%%S%s%s%s%s", |
mandoc_asprintf(&conf.man, "/%s%s%%N.%%S", |
scriptname, |
usepath ? req->q.manpath : "", usepath ? "/" : ""); |
req->q.arch ? "&arch=" : "", |
|
req->q.arch ? req->q.arch : "", |
|
usepath ? "&manpath=" : "", |
|
usepath ? req->q.manpath : ""); |
|
|
|
mparse_result(mp, &man, NULL); |
mparse_result(mp, &man, NULL); |
if (man == NULL) { |
if (man == NULL) { |