version 1.62, 2014/07/11 22:25:44 |
version 1.64, 2014/07/12 01:55:30 |
Line 165 html_printquery(const struct req *req) |
|
Line 165 html_printquery(const struct req *req) |
|
} |
} |
if (NULL != req->q.expr) { |
if (NULL != req->q.expr) { |
printf("&expr="); |
printf("&expr="); |
html_print(req->q.expr ? req->q.expr : ""); |
html_print(req->q.expr); |
} |
} |
} |
} |
|
|
|
|
http_decode(char *p) |
http_decode(char *p) |
{ |
{ |
char hex[3]; |
char hex[3]; |
|
char *q; |
int c; |
int c; |
|
|
hex[2] = '\0'; |
hex[2] = '\0'; |
|
|
for ( ; '\0' != *p; p++) { |
q = p; |
|
for ( ; '\0' != *p; p++, q++) { |
if ('%' == *p) { |
if ('%' == *p) { |
if ('\0' == (hex[0] = *(p + 1))) |
if ('\0' == (hex[0] = *(p + 1))) |
return(0); |
return(0); |
Line 299 http_decode(char *p) |
|
Line 301 http_decode(char *p) |
|
if ('\0' == c) |
if ('\0' == c) |
return(0); |
return(0); |
|
|
*p = (char)c; |
*q = (char)c; |
memmove(p + 1, p + 3, strlen(p + 3) + 1); |
p += 2; |
} else |
} else |
*p = '+' == *p ? ' ' : *p; |
*q = '+' == *p ? ' ' : *p; |
} |
} |
|
|
*p = '\0'; |
*q = '\0'; |
return(1); |
return(1); |
} |
} |
|
|
Line 413 resp_index(const struct req *req) |
|
Line 415 resp_index(const struct req *req) |
|
"<A HREF=\"http://mdocml.bsd.lv/\">mandoc</A>\n" |
"<A HREF=\"http://mdocml.bsd.lv/\">mandoc</A>\n" |
"</H1>"); |
"</H1>"); |
resp_searchform(req); |
resp_searchform(req); |
puts("<P>\n" |
printf("<P>\n" |
"This web interface is documented in the " |
"This web interface is documented in the " |
"<A HREF=\"search?expr=Nm~^man\\.cgi$&sec=8\">" |
"<A HREF=\"%s/search?expr=Nm~^man\\.cgi$&sec=8\">" |
"man.cgi</A> manual, and the " |
"man.cgi</A> manual, and the " |
"<A HREF=\"search?expr=Nm~^apropos$&sec=1\">" |
"<A HREF=\"%s/search?expr=Nm~^apropos$&sec=1\">" |
"apropos</A> manual explains the query syntax.\n" |
"apropos</A> manual explains the query syntax.\n" |
"</P>"); |
"</P>\n", |
|
scriptname, scriptname); |
resp_end_html(); |
resp_end_html(); |
} |
} |
|
|