summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/cgi.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-07-24 20:30:38 +0000
committerschwarze <schwarze@openbsd.org>2014-07-24 20:30:38 +0000
commit923fed8aa9a44ce109722816b3ea0749ba63cf56 (patch)
treef8364b026f61ca5fbdcbf51b4f843022ee886f81 /usr.bin/mandoc/cgi.c
parentProvide eeprom(8) on the sparc installation media. Intended to help diagnosing (diff)
downloadwireguard-openbsd-923fed8aa9a44ce109722816b3ea0749ba63cf56.tar.xz
wireguard-openbsd-923fed8aa9a44ce109722816b3ea0749ba63cf56.zip
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 'usr.bin/mandoc/cgi.c')
-rw-r--r--usr.bin/mandoc/cgi.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index bc474a6b930..f0168e841c2 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $Id: cgi.c,v 1.21 2014/07/24 08:25:45 schwarze Exp $ */
+/* $Id: cgi.c,v 1.22 2014/07/24 20:30:38 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@usta.de>
@@ -49,7 +49,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 *);
@@ -589,8 +588,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\">");
@@ -1055,14 +1052,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.
*/