On Fri, Aug 14, 2015 at 6:28 PM, Davide Del Zompo <davide.delzo...@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