Re: [PATCH] rl_change_case: skip over invalid mbchars

2024-05-25 Thread Chet Ramey
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 h

Re: [PATCH] rl_change_case: skip over invalid mbchars

2024-05-23 Thread Grisha Levit
On Thu, May 23, 2024 at 4:11 PM Chet Ramey wrote: > > On 5/23/24 3:25 PM, Grisha Levit wrote: > > On Thu, May 23, 2024 at 10:25 AM Chet Ramey 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

Re: [PATCH] rl_change_case: skip over invalid mbchars

2024-05-23 Thread Chet Ramey
On 5/23/24 3:25 PM, Grisha Levit wrote: On Thu, May 23, 2024 at 10:25 AM Chet Ramey 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 foll

Re: [PATCH] rl_change_case: skip over invalid mbchars

2024-05-23 Thread Grisha Levit
On Thu, May 23, 2024 at 10:25 AM Chet Ramey 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=-

Re: [PATCH] rl_change_case: skip over invalid mbchars

2024-05-23 Thread Chet Ramey
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? Also, not sure it makes sense to change the case of an invalid byte cast to (wchar_t). Bash and readline are pretty consistent about