]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Stay ASCII-compatible for toupper_m/tolower_m
authorVolker Lendecke <vl@samba.org>
Fri, 18 Feb 2022 16:36:08 +0000 (17:36 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 4 Apr 2022 11:45:24 +0000 (11:45 +0000)
This is an alternative patch for MR2339: It seems that Windows AD in
turkish locale is ASCII-compatible with 'i'. Björn tells me that the
turkish locale is the only one where upper/lower casing letters in the
ASCII range is not compatible to ASCII.

Simplify our code by not calling the locale-specific standard
toupper/tolower for the ASCII range but rely on our tables.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Apr  4 11:45:24 UTC 2022 on sn-devel-184

lib/util/charset/codepoints.c

index 3f380b9fed6a762057b1cfe80edd0779c3129f56..c35241e298331550f47f4076b478cdce8a1d84f9 100644 (file)
@@ -16441,9 +16441,6 @@ void smb_init_locale(void)
 **/
 _PUBLIC_ codepoint_t toupper_m(codepoint_t val)
 {
-       if (val < 128) {
-               return toupper(val);
-       }
        if (val >= ARRAY_SIZE(upcase_table)) {
                return val;
        }
@@ -16455,9 +16452,6 @@ _PUBLIC_ codepoint_t toupper_m(codepoint_t val)
 **/
 _PUBLIC_ codepoint_t tolower_m(codepoint_t val)
 {
-       if (val < 128) {
-               return tolower(val);
-       }
        if (val >= ARRAY_SIZE(lowcase_table)) {
                return val;
        }