On 5/23/24 3:25 PM, Grisha Levit wrote:
On Thu, May 23, 2024 at 10:25 AM Chet Ramey <chet.ra...@case.edu> wrote:

On 5/21/24 2:42 PM, Grisha Levit wrote:
Avoid using (size_t)-1 as an offset.

I can't reproduce this on macOS. Where is the code that's using -1 as an
offset?

The loop in rl_change_case does the following:

     rl_change_case(count=-1, op=2) at text.c:1483:9
        1481   while (start < end)
        1482     {
     -> 1483       c = _rl_char_value (rl_line_buffer, start);

     _rl_char_value(buf="\xc0", ind=0) at mbutil.c:493:23
        491    l = strlen (buf);
        492    if (ind + 1 >= l)
     -> 493      return ((WCHAR_T) buf[ind]);

     (wchar_t) c = L'À'

Nope, this is where you lose me. Using lldb with an input file created
from the string you sent, I get c = (wchar_t) L'\U0000fffd', which fails
the rl_walphabetic test. Even running the command as you posted it just
prints `?'. What os are you using?

Maybe I'll try it some other places, but I don't have any other readily
available machines to run address sanitizer, so I'll have to eyeball it.
Maybe later.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to