summaryrefslogtreecommitdiffstats
path: root/cgi.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-24 20:30:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-24 20:30:45 +0000
commit5ca2f2ec3d00b0df8785d12283e1eff4e6a414f1 (patch)
tree01bff8de4048e5c059818ab7eb545f5ce4a80811 /cgi.c
parent4d3e662fd848a0d5fbda1bc38e39aeb05d9b34dc (diff)
downloadmandoc-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.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/cgi.c b/cgi.c
index 5a20f9ce..388ab61b 100644
--- a/cgi.c
+++ b/cgi.c
@@ -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.
*/