version 1.77, 2014/07/19 13:15:11 |
version 1.79, 2014/07/21 22:33:01 |
Line 71 static void pg_noresult(const struct req *, const ch |
|
Line 71 static void pg_noresult(const struct req *, const ch |
|
static void pg_search(const struct req *); |
static void pg_search(const struct req *); |
static void pg_searchres(const struct req *, |
static void pg_searchres(const struct req *, |
struct manpage *, size_t); |
struct manpage *, size_t); |
static void pg_show(const struct req *, const char *); |
static void pg_show(struct req *, const char *); |
static void resp_begin_html(int, const char *); |
static void resp_begin_html(int, const char *); |
static void resp_begin_http(int, const char *); |
static void resp_begin_http(int, const char *); |
static void resp_end_html(void); |
static void resp_end_html(void); |
Line 564 pg_searchres(const struct req *req, struct manpage *r, |
|
Line 564 pg_searchres(const struct req *req, struct manpage *r, |
|
* without any delay. |
* without any delay. |
*/ |
*/ |
printf("Status: 303 See Other\r\n"); |
printf("Status: 303 See Other\r\n"); |
printf("Location: %s/%s/%s?", |
printf("Location: http://%s%s/%s/%s?", |
scriptname, req->q.manpath, r[0].file); |
HTTP_HOST, scriptname, req->q.manpath, r[0].file); |
http_printquery(req); |
http_printquery(req); |
printf("\r\n" |
printf("\r\n" |
"Content-Type: text/html; charset=utf-8\r\n" |
"Content-Type: text/html; charset=utf-8\r\n" |
Line 785 format(const struct req *req, const char *file) |
|
Line 785 format(const struct req *req, const char *file) |
|
return; |
return; |
} |
} |
|
|
snprintf(opts, sizeof(opts), |
snprintf(opts, sizeof(opts), "fragment,man=%s?" |
"fragment,man=%s?query=%%N&sec=%%S", |
"manpath=%s&query=%%N&sec=%%S&arch=%s", |
scriptname); |
scriptname, req->q.manpath, |
|
req->q.arch ? req->q.arch : ""); |
|
|
mparse_result(mp, &mdoc, &man, NULL); |
mparse_result(mp, &mdoc, &man, NULL); |
if (NULL == man && NULL == mdoc) { |
if (NULL == man && NULL == mdoc) { |
Line 823 resp_show(const struct req *req, const char *file) |
|
Line 824 resp_show(const struct req *req, const char *file) |
|
} |
} |
|
|
static void |
static void |
pg_show(const struct req *req, const char *path) |
pg_show(struct req *req, const char *path) |
{ |
{ |
char *sub; |
char *sub; |
|
|
Line 858 pg_show(const struct req *req, const char *path) |
|
Line 859 pg_show(const struct req *req, const char *path) |
|
"You specified an invalid manual file."); |
"You specified an invalid manual file."); |
return; |
return; |
} |
} |
|
|
|
if (strcmp(path, "mandoc")) |
|
req->q.manpath = path; |
|
|
resp_begin_html(200, NULL); |
resp_begin_html(200, NULL); |
resp_searchform(req); |
resp_searchform(req); |