discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Yuri Pankov <yuripv@yuripv.net>
To: discuss@mandoc.bsd.lv
Subject: using "bits" comparison in manpage_compare()
Date: Tue, 30 Oct 2018 01:41:23 +0300	[thread overview]
Message-ID: <ccbfd775-6f30-1e33-d919-17698a084095@yuripv.net> (raw)

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

             reply	other threads:[~2018-10-29 22:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 22:41 Yuri Pankov [this message]
2018-11-21 15:17 ` Yuri Pankov
2018-11-22 12:11 ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccbfd775-6f30-1e33-d919-17698a084095@yuripv.net \
    --to=yuripv@yuripv.net \
    --cc=discuss@mandoc.bsd.lv \
    --subject='Re: using "bits" comparison in manpage_compare()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).