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 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, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Incorrect string length check

2024-05-25 Thread Chet Ramey

On 5/23/24 9:55 PM, Collin Funk wrote:

Hi Chet,

In this commit in the devel branch:

commit 03c8c43b79177fa678714893e9f05b1c517592c0
Author: Chet Ramey 
Date:   Fri Apr 5 09:03:52 2024 -0400

 man page typesetting updates for compatibilityand layout issues

I think there was a typo in execute_cmd.c:

[...]

Shouldn't that condition be something like this:

 if (ilen > 0 && interp[ilen - 1] == '\r')
   {
 /* Rest of code.  */
   }


Yep, good typo catch. Thanks.

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



OpenPGP_signature.asc
Description: OpenPGP digital signature