Re: [hackers] [dmenu][PATCH] Revert "fix input text matching"

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 11 Dec 2016 12:37:19 +0100

On Wed, Dec 07, 2016 at 09:45:01AM -0500, Andrew Gregory wrote:
> This reverts commit 09d0a36e0370f7ca9bdb171bf93c5ac3131c5a92.
>
> Using strncmp with the length of the user input turns it into a prefix
> match rather than an exact match as it's supposed to be.
> ---
> dmenu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dmenu.c b/dmenu.c
> index 1cfefcd..d605ab4 100644
> --- a/dmenu.c
> +++ b/dmenu.c
> _AT_@ -228,7 +228,7 @@ match(void)
> len = tokc ? strlen(tokv[0]) : 0;
>
> matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL;
> - textsize = strlen(text);
> + textsize = strlen(text) + 1;
> for (item = items; item && item->text; item++) {
> for (i = 0; i < tokc; i++)
> if (!fstrstr(item->text, tokv[i]))
> --
> 2.10.2
>
>

Thanks for the patch, it is pushed to master.

-- 
Kind regards,
Hiltjo
Received on Sun Dec 11 2016 - 12:37:19 CET

This archive was generated by hypermail 2.3.0 : Sun Dec 11 2016 - 12:48:21 CET