mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
util:charset:codepoints: codepoint_cmpi warning about non-transitivity
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
675fdeee3d
commit
f07ae69907
@ -16480,6 +16480,18 @@ _PUBLIC_ bool isupper_m(codepoint_t val)
|
||||
*/
|
||||
_PUBLIC_ int codepoint_cmpi(codepoint_t c1, codepoint_t c2)
|
||||
{
|
||||
/*
|
||||
* FIXME: this is unsuitable for use in a sort, as the
|
||||
* comparison is intransitive.
|
||||
*
|
||||
* The problem is toupper_m() is only called on equality case,
|
||||
* which has strange effects.
|
||||
*
|
||||
* Consider {'a', 'A', 'B'}.
|
||||
* 'a' == 'A'
|
||||
* 'a' > 'B' (lowercase letters come after upper)
|
||||
* 'A' < 'B'
|
||||
*/
|
||||
if (c1 == c2 ||
|
||||
toupper_m(c1) == toupper_m(c2)) {
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user