discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Yuri Pankov <yuripv@yuripv.net>
To: discuss@mandoc.bsd.lv
Subject: Re: using "bits" comparison in manpage_compare()
Date: Wed, 21 Nov 2018 18:17:16 +0300	[thread overview]
Message-ID: <516e2122-2c87-3a4d-c663-1b373a0898fd@yuripv.net> (raw)
In-Reply-To: <ccbfd775-6f30-1e33-d919-17698a084095@yuripv.net>


[-- Attachment #1.1: Type: text/plain, Size: 773 bytes --]

Yuri Pankov wrote:
> 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. */

Any thoughts on this?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-11-21 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 22:41 Yuri Pankov
2018-11-21 15:17 ` Yuri Pankov [this message]
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=516e2122-2c87-3a4d-c663-1b373a0898fd@yuripv.net \
    --to=yuripv@yuripv.net \
    --cc=discuss@mandoc.bsd.lv \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).