diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-24 20:30:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-07-24 20:30:45 +0000 |
commit | 5ca2f2ec3d00b0df8785d12283e1eff4e6a414f1 (patch) | |
tree | 01bff8de4048e5c059818ab7eb545f5ce4a80811 /cgi.c | |
parent | 4d3e662fd848a0d5fbda1bc38e39aeb05d9b34dc (diff) | |
download | mandoc-5ca2f2ec3d00b0df8785d12283e1eff4e6a414f1.tar.gz |
Sort result pages first by section number, then by name.
By moving the sort from cgi.c to mansearch.c, we get two advantages:
Easier access to the data needed for sorting, in particular the section
number, and the apropos(1) command line utility profits as well.
Feature requested by deraadt@.
Diffstat (limited to 'cgi.c')
-rw-r--r-- | cgi.c | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -53,7 +53,6 @@ struct req { }; static void catman(const struct req *, const char *); -static int cmp(const void *, const void *); static void format(const struct req *, const char *); static void html_print(const char *); static void html_printquery(const struct req *); @@ -593,8 +592,6 @@ pg_searchres(const struct req *req, struct manpage *r, size_t sz) return; } - qsort(r, sz, sizeof(struct manpage), cmp); - resp_begin_html(200, NULL); resp_searchform(req); puts("<DIV CLASS=\"results\">"); @@ -1059,14 +1056,6 @@ main(void) return(EXIT_SUCCESS); } -static int -cmp(const void *p1, const void *p2) -{ - - return(strcasecmp(((const struct manpage *)p1)->names, - ((const struct manpage *)p2)->names)); -} - /* * Scan for indexable paths. */ |