Re: bug in strcasecmp and strncasecmp

2025-02-17 Thread Brian Inglis via Cygwin
On 2025-02-17 03:00, Corinna Vinschen via Cygwin wrote: On Feb 16 17:18, Bruno Haible via Cygwin wrote: Per POSIX [1], the functions strcasecmp and strncasecmp should "use the current locale to determine the case of the characters.". [1] https://pubs.opengroup.org/onlinepubs/9799919799/function

Re: bug in strcasecmp and strncasecmp

2025-02-17 Thread Bruno Haible via Cygwin
Corinna Vinschen wrote: > > They can't work on multibyte strings. This is evident from the fact that > > strncasecmp gets one integer as argument, not two integers. > > Good point. > > With standard functions, one really should convert MB string to wide > char and call wcscasecmp, etc. Nope, wid

Re: bug in strcasecmp and strncasecmp

2025-02-17 Thread Corinna Vinschen via Cygwin
On Feb 17 11:49, Bruno Haible via Cygwin wrote: > Corinna Vinschen wrote: > > Adding a cast fixes that and I just pushed a matching patch. > > Thanks. > > > I'm just not sure if that's sufficient in the light of POSIX.1-2024. > > The above expression seems to indicate that strcasecmp and friends

Re: bug in strcasecmp and strncasecmp

2025-02-17 Thread Bruno Haible via Cygwin
Corinna Vinschen wrote: > Adding a cast fixes that and I just pushed a matching patch. Thanks. > I'm just not sure if that's sufficient in the light of POSIX.1-2024. > The above expression seems to indicate that strcasecmp and friends are > now expected to work on multibyte codesets like UTF-8.

Re: bug in strcasecmp and strncasecmp

2025-02-17 Thread Corinna Vinschen via Cygwin
Hi Bruno, On Feb 16 17:18, Bruno Haible via Cygwin wrote: > Per POSIX [1], the functions strcasecmp and strncasecmp should > "use the current locale to determine the case of the characters.". > > [1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/strcasecmp.html > > This is not what