version 1.100, 2014/10/28 17:36:19 |
version 1.102, 2014/11/26 17:55:27 |
Line 163 http_printquery(const struct req *req, const char *sep |
|
Line 163 http_printquery(const struct req *req, const char *sep |
|
printf("%sarch=", sep); |
printf("%sarch=", sep); |
http_print(req->q.arch); |
http_print(req->q.arch); |
} |
} |
if (NULL != req->q.manpath && |
if (strcmp(req->q.manpath, req->p[0])) { |
strcmp(req->q.manpath, req->p[0])) { |
|
printf("%smanpath=", sep); |
printf("%smanpath=", sep); |
http_print(req->q.manpath); |
http_print(req->q.manpath); |
} |
} |
|
|
if (*qs != '\0') |
if (*qs != '\0') |
qs++; |
qs++; |
} |
} |
|
|
/* Fall back to the default manpath. */ |
|
|
|
if (req->q.manpath == NULL) |
|
req->q.manpath = mandoc_strdup(req->p[0]); |
|
} |
} |
|
|
static void |
static void |
Line 469 resp_searchform(const struct req *req) |
|
Line 463 resp_searchform(const struct req *req) |
|
puts("<SELECT NAME=\"manpath\">"); |
puts("<SELECT NAME=\"manpath\">"); |
for (i = 0; i < (int)req->psz; i++) { |
for (i = 0; i < (int)req->psz; i++) { |
printf("<OPTION "); |
printf("<OPTION "); |
if (NULL == req->q.manpath ? 0 == i : |
if (strcmp(req->q.manpath, req->p[i]) == 0) |
0 == strcmp(req->q.manpath, req->p[i])) |
|
printf("SELECTED=\"selected\" "); |
printf("SELECTED=\"selected\" "); |
printf("VALUE=\""); |
printf("VALUE=\""); |
html_print(req->p[i]); |
html_print(req->p[i]); |
Line 977 pg_search(const struct req *req) |
|
Line 970 pg_search(const struct req *req) |
|
search.sec = req->q.sec; |
search.sec = req->q.sec; |
search.outkey = "Nd"; |
search.outkey = "Nd"; |
search.argmode = req->q.equal ? ARG_NAME : ARG_EXPR; |
search.argmode = req->q.equal ? ARG_NAME : ARG_EXPR; |
|
search.firstmatch = 1; |
|
|
paths.sz = 1; |
paths.sz = 1; |
paths.paths = mandoc_malloc(sizeof(char *)); |
paths.paths = mandoc_malloc(sizeof(char *)); |
|
|
if (NULL != (querystring = getenv("QUERY_STRING"))) |
if (NULL != (querystring = getenv("QUERY_STRING"))) |
http_parse(&req, querystring); |
http_parse(&req, querystring); |
|
|
if ( ! (NULL == req.q.manpath || |
if (req.q.manpath == NULL) |
validate_manpath(&req, req.q.manpath))) { |
req.q.manpath = mandoc_strdup(req.p[0]); |
|
else if ( ! validate_manpath(&req, req.q.manpath)) { |
pg_error_badrequest( |
pg_error_badrequest( |
"You specified an invalid manpath."); |
"You specified an invalid manpath."); |
return(EXIT_FAILURE); |
return(EXIT_FAILURE); |