Make man page lookup case-insensitive.
[rsc] --rw-rw-r-- M 771144 glenda sys 9069 Feb 11 09:15 sys/src/cmd/ip/httpd/man2html.c
/n/sourcesdump/2006/0211/plan9/sys/src/cmd/ip/httpd/man2html.c:162,167 -
/n/sourcesdump/2006/0212/plan9/sys/src/cmd/ip/httpd/man2html.c:162,175
}
void
+ strlwr(char *p)
+ {
+ for(; *p; p++)
+ if('A' <= *p && *p <= 'Z')
+ *p += 'a'-'A';
+ }
+
+ void
redirectto(char *uri)
{
if(connect){
/n/sourcesdump/2006/0211/plan9/sys/src/cmd/ip/httpd/man2html.c:313,323 -
/n/sourcesdump/2006/0212/plan9/sys/src/cmd/ip/httpd/man2html.c:321,340
p = strstr(uri, "/intro");
if(p == nil){
+ while(*uri == '/')
+ uri++;
/* redirect section requests */
snprint(file, sizeof(file), "/sys/man/%s", uri);
d = dirstat(file);
- if(d == nil)
+ if(d == nil){
+ strlwr(file);
+ if(dirstat(file) != nil){
+ snprint(file, sizeof(file), "/magic/man2html/%s", uri);
+ strlwr(file);
+ redirectto(file);
+ }
error(uri, "man page not found");
+ }
x = d->qid.type;
free(d);
if(x & QTDIR){
|