discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* using "bits" comparison in manpage_compare()
@ 2018-10-29 22:41 Yuri Pankov
  2018-11-21 15:17 ` Yuri Pankov
  2018-11-22 12:11 ` Ingo Schwarze
  0 siblings, 2 replies; 3+ messages in thread
From: Yuri Pankov @ 2018-10-29 22:41 UTC (permalink / raw)
  To: discuss

Hi,

It looks like using "bits" comparison in manpage_compare() leads to
somewhat inconsistent output sorting for apropos(1), reported as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227408.

So I've proposed the change below as a "fix", any thoughts on it?

Index: contrib/mandoc/mansearch.c
===================================================================
--- contrib/mandoc/mansearch.c
+++ contrib/mandoc/mansearch.c
@@ -412,8 +412,7 @@

 	mp1 = vp1;
 	mp2 = vp2;
-	if ((diff = mp2->bits - mp1->bits) ||
-	    (diff = mp1->sec - mp2->sec))
+	if ((diff = mp1->sec - mp2->sec) != 0)
 		return diff;

 	/* Fall back to alphabetic ordering of names. */
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-22 12:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-29 22:41 using "bits" comparison in manpage_compare() Yuri Pankov
2018-11-21 15:17 ` Yuri Pankov
2018-11-22 12:11 ` Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).