bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] rl_change_case: skip over invalid mbchars


From: Chet Ramey
Subject: Re: [PATCH] rl_change_case: skip over invalid mbchars
Date: Sat, 25 May 2024 15:24:24 -0400
User-agent: Mozilla Thunderbird

On 5/23/24 3:25 PM, Grisha Levit wrote:

Then we again interpret \xC0 as if it were \u00C0:

     rl_change_case(count=-1, op=2) at text.c:1514:20
        1513           if (MB_INVALIDCH (m))
     -> 1514             wc = (WCHAR_T)rl_line_buffer[start];

     (wchar_t) wc = L'À'

Sometimes the hardest part is being able to reproduce the issue. The right
thing to do here is to treat an invalid multibyte character as a sequence
of bytes, consistent with how, say, _rl_find_next_mbchar_internal() does.
Since it does, next will be start + 1 and we should treat
rl_line_buffer[start] as a single byte.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]