version 1.20, 2011/12/09 11:29:19 |
version 1.23, 2011/12/10 10:59:21 |
Line 128 kval_query(struct query *q, const struct kval *fields, |
|
Line 128 kval_query(struct query *q, const struct kval *fields, |
|
int i, legacy; |
int i, legacy; |
|
|
memset(q, 0, sizeof(struct query)); |
memset(q, 0, sizeof(struct query)); |
|
q->whatis = 1; |
legacy = -1; |
legacy = -1; |
|
|
for (i = 0; i < (int)sz; i++) |
for (i = 0; i < (int)sz; i++) |
Line 158 kval_query(struct query *q, const struct kval *fields, |
|
Line 159 kval_query(struct query *q, const struct kval *fields, |
|
q->whatis = 1; |
q->whatis = 1; |
} |
} |
|
|
/* Section "0" means no section when in legacy mode. */ |
/* |
|
* Section "0" means no section when in legacy mode. |
|
* For some man.cgi scripts, "default" arch is none. |
|
*/ |
|
|
if (q->legacy && NULL != q->sec && 0 == strcmp(q->sec, "0")) |
if (q->legacy && NULL != q->sec) |
q->sec = NULL; |
if (0 == strcmp(q->sec, "0")) |
|
q->sec = NULL; |
|
if (q->legacy && NULL != q->arch) |
|
if (0 == strcmp(q->arch, "default")) |
|
q->arch = NULL; |
} |
} |
|
|
/* |
/* |
Line 433 resp_error400(void) |
|
Line 441 resp_error400(void) |
|
"<P>\n" |
"<P>\n" |
"The query your entered was malformed.\n" |
"The query your entered was malformed.\n" |
"Try again from the\n" |
"Try again from the\n" |
"<A HREF=\"%s/index.html\">main page</A>\n" |
"<A HREF=\"%s/index.html\">main page</A>.\n" |
"</P>", progname); |
"</P>", progname); |
resp_end_html(); |
resp_end_html(); |
} |
} |
Line 451 resp_error404(const char *page) |
|
Line 459 resp_error404(const char *page) |
|
printf("</B>,\n" |
printf("</B>,\n" |
"could not be found.\n" |
"could not be found.\n" |
"Try searching from the\n" |
"Try searching from the\n" |
"<A HREF=\"%s/index.html\">main page</A>\n" |
"<A HREF=\"%s/index.html\">main page</A>.\n" |
"</P>", progname); |
"</P>", progname); |
resp_end_html(); |
resp_end_html(); |
} |
} |
Line 502 resp_search(struct res *r, size_t sz, void *arg) |
|
Line 510 resp_search(struct res *r, size_t sz, void *arg) |
|
kval_query(&q, req->fields, req->fieldsz); |
kval_query(&q, req->fields, req->fieldsz); |
|
|
if (0 == sz) { |
if (0 == sz) { |
puts("<P>\n" |
printf("<P>\n" |
"No results found."); |
"No %s results found.", |
|
q.whatis ? "whatis" : "apropos"); |
if (q.whatis) { |
if (q.whatis) { |
printf("(Try <A HREF=\""); |
printf("(Try <A HREF=\""); |
html_print(progname); |
html_print(progname); |