=================================================================== RCS file: /cvs/mandoc/cgi.c,v retrieving revision 1.14 retrieving revision 1.16 diff -u -p -r1.14 -r1.16 --- mandoc/cgi.c 2011/12/07 15:55:06 1.14 +++ mandoc/cgi.c 2011/12/07 16:18:52 1.16 @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.14 2011/12/07 15:55:06 kristaps Exp $ */ +/* $Id: cgi.c,v 1.16 2011/12/07 16:18:52 kristaps Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -67,6 +67,7 @@ struct req { static int atou(const char *, unsigned *); static void catman(const char *); +static int cmp(const void *, const void *); static void format(const char *); static void html_print(const char *); static void html_putchar(char); @@ -340,6 +341,7 @@ resp_searchform(const struct req *req) html_print(progname); printf("/search.html\" METHOD=\"get\">\n"); printf("
\n" + "Search Parameters\n" " or \n" "", r[i].volume, r[i].rec); - for (cp = r[i].title; '\0' != *cp; cp++) - html_putchar(toupper((unsigned char)*cp)); + html_print(r[i].title); putchar('('); html_print(r[i].cat); if (r[i].arch && '\0' != *r[i].arch) { @@ -467,6 +469,8 @@ resp_search(struct res *r, size_t sz, void *arg) puts(""); } + puts(""); + resp_end_html(); } @@ -752,7 +756,7 @@ pg_search(const struct manpaths *ps, const struct req cp = NULL; ep = NULL; sz = 0; - whatis = 0; + whatis = 1; memset(&opt, 0, sizeof(struct opts)); @@ -917,3 +921,12 @@ main(void) return(EXIT_SUCCESS); } + +static int +cmp(const void *p1, const void *p2) +{ + + return(strcasecmp(((const struct res *)p1)->title, + ((const struct res *)p2)->title)); +} +