version 1.26, 2011/12/10 22:45:47 |
version 1.27, 2011/12/10 23:04:31 |
Line 364 resp_end_html(void) |
|
Line 364 resp_end_html(void) |
|
static void |
static void |
resp_searchform(const struct req *req) |
resp_searchform(const struct req *req) |
{ |
{ |
|
int i; |
|
|
puts("<!-- Begin search form. //-->"); |
puts("<!-- Begin search form. //-->"); |
printf("<FORM ACTION=\""); |
printf("<FORM ACTION=\""); |
Line 385 resp_searchform(const struct req *req) |
|
Line 386 resp_searchform(const struct req *req) |
|
"<INPUT TYPE=\"text\"" |
"<INPUT TYPE=\"text\"" |
" SIZE=\"8\" NAME=\"arch\" VALUE=\""); |
" SIZE=\"8\" NAME=\"arch\" VALUE=\""); |
html_print(req->q.arch ? req->q.arch : ""); |
html_print(req->q.arch ? req->q.arch : ""); |
puts("\">.\n" |
printf("\">"); |
|
if (req->psz > 1) { |
|
puts(", <SELECT NAME=\"manpath\">"); |
|
for (i = 0; i < (int)req->psz; i++) { |
|
printf("<OPTION %s VALUE=\"", |
|
(i == req->q.manroot) || |
|
(0 == i && -1 == req->q.manroot) ? |
|
"SELECTED=\"selected\"" : ""); |
|
html_print(req->p[i].name); |
|
printf("\">"); |
|
html_print(req->p[i].name); |
|
puts("</OPTION>"); |
|
} |
|
puts("</SELECT>"); |
|
} |
|
puts(".\n" |
"<INPUT TYPE=\"reset\" VALUE=\"Reset\">\n" |
"<INPUT TYPE=\"reset\" VALUE=\"Reset\">\n" |
"</FIELDSET>\n" |
"</FIELDSET>\n" |
"</FORM>"); |
"</FORM>"); |
Line 1100 pathgen(DIR *dir, char *path, struct req *req) |
|
Line 1116 pathgen(DIR *dir, char *path, struct req *req) |
|
|
|
if (rc > 0) { |
if (rc > 0) { |
/* This also strips the trailing slash. */ |
/* This also strips the trailing slash. */ |
path[(int)sz - 1] = '\0'; |
path[(int)--sz] = '\0'; |
req->p = mandoc_realloc |
req->p = mandoc_realloc |
(req->p, |
(req->p, |
(req->psz + 1) * sizeof(struct paths)); |
(req->psz + 1) * sizeof(struct paths)); |
|
/* |
|
* Strip out the leading "./" unless we're just a ".", |
|
* in which case use an empty string as our name. |
|
*/ |
req->p[(int)req->psz].path = mandoc_strdup(path); |
req->p[(int)req->psz].path = mandoc_strdup(path); |
/* And this strips out the leading "./". */ |
|
req->p[(int)req->psz].name = |
req->p[(int)req->psz].name = |
cp = mandoc_strdup(path + 2); |
cp = mandoc_strdup(path + (1 == sz ? 1 : 2)); |
req->psz++; |
req->psz++; |
/* |
/* |
* The name is just the path with all the slashes taken |
* The name is just the path with all the slashes taken |