aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mansearch.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-11-22 12:01:46 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-11-22 12:01:46 +0000
commit948cfc767fc01b4caf82976949dceb3581462b3e (patch)
treee239f4302dd84fd27131c98bbb60c827f476374c /mansearch.c
parent8653551cb202b50a668483cb155c4c8272808ae8 (diff)
downloadmandoc-948cfc767fc01b4caf82976949dceb3581462b3e.tar.gz
mandoc-948cfc767fc01b4caf82976949dceb3581462b3e.tar.zst
mandoc-948cfc767fc01b4caf82976949dceb3581462b3e.zip
In apropos(1) output, stop sorting .Nm search results by name
priorities (bits). The obscure feature wasn't documented and merely confused people - for example Edward Tomasz Napierala <trasz at FreeBSD>, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227408. Smaller patch provided by Yuri Pankov <yuripv at FreeBSD>, but i'm also retiring the now unused "bits" member from struct manpage. Simplification is good.
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mansearch.c b/mansearch.c
index 9cfd64a2..92bb68db 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.78 2018/11/19 19:27:37 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.79 2018/11/22 12:01:46 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -201,7 +201,6 @@ mansearch(const struct mansearch *search,
mpage->names = buildnames(page);
mpage->output = buildoutput(outkey, page);
mpage->ipath = i;
- mpage->bits = rp->bits;
mpage->sec = *page->sect - '0';
if (mpage->sec < 0 || mpage->sec > 9)
mpage->sec = 10;
@@ -296,10 +295,8 @@ manmerge_term(struct expr *e, struct ohash *htab)
break;
slot = ohash_lookup_memory(htab,
(char *)&res, sizeof(res.page), res.page);
- if ((rp = ohash_find(htab, slot)) != NULL) {
- rp->bits |= res.bits;
+ if ((rp = ohash_find(htab, slot)) != NULL)
continue;
- }
rp = mandoc_malloc(sizeof(*rp));
*rp = res;
ohash_insert(htab, slot, rp);
@@ -412,8 +409,7 @@ manpage_compare(const void *vp1, const void *vp2)
mp1 = vp1;
mp2 = vp2;
- if ((diff = mp2->bits - mp1->bits) ||
- (diff = mp1->sec - mp2->sec))
+ if ((diff = mp1->sec - mp2->sec))
return diff;
/* Fall back to alphabetic ordering of names. */