Re: [hackers] [dmenu][PATCH] fix a bug introduced by e2a2805 that that ignores composed characters

From: nzl <uruabi_AT_gmail.com>
Date: Fri, 16 Mar 2018 18:24:23 +0800

> Ah, could you provide a test-case for this?

It stops input from IME, and I tested the status returned from
XmbLookupString was XLookupChars.

> This may solve the introduced regression, but introduces a new bug.

Indeed, how about initializing buf to '\0'.

On Thu, Mar 15, 2018 at 11:59 PM, Quentin Rameau <quinq_AT_fifth.space> wrote:
>> XmbLookupString may not return a keysym, but only a string for
>> composed characters.
>
> Ah, could you provide a test-case for this?
>
>> ---
>> dmenu.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/dmenu.c b/dmenu.c
>> index 5e9c367..3a3f8e4 100644
>> --- a/dmenu.c
>> +++ b/dmenu.c
>> _AT_@ -387,12 +387,11 @@ keypress(XKeyEvent *ev)
>> return;
>> }
>> switch(ksym) {
>> + case NoSymbol:
>> default:
>> if (!iscntrl(*buf))
>> insert(buf, len);
>> break;
>> - case NoSymbol:
>> - break;
>> case XK_Delete:
>> if (text[cursor] == '\0')
>> return;
>
> This may solve the introduced regression, but introduces a new bug.
>
Received on Fri Mar 16 2018 - 11:24:23 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 16 2018 - 11:36:27 CET