Re: [hackers] [dmenu] Fix incorrect ordering of matching results
On Fri, Aug 14, 2015 at 6:28 PM, Davide Del Zompo
<davide.delzompo_AT_gmail.com> wrote:
> dmenu incorrectly orders matching results:
>
> $ dmenu <<EOF
> suck xless
> suck less
> EOF
>
> Typing 'suck less' shows 'suck xless' as first result, however, according to a
> comment in the source code, this is not the intended behaviour:
> /* exact matches go first, then prefixes, then substrings */
>
> The attached patch should fix the problem. Regarding the third argument to
> fstrncmp: assuming fstrncmp, whatever it points to, behaves as strncmp (i.e.
> "characters that follow a null byte are not compared"), both 'strlen(text) + 1'
> and 'strlen(item->text) + 1' should be safe.
Hi,
Better late than never, I have applied your patch with a minor
optimization (textsize).
Additionally I have modified the git author name to be less funky (sorry).
Kind regards,
Hiltjo
Received on Sun Oct 04 2015 - 14:07:54 CEST
This archive was generated by hypermail 2.3.0
: Sun Oct 04 2015 - 14:12:11 CEST