From: Volker Lendecke Date: Fri, 18 Feb 2022 16:36:08 +0000 (+0100) Subject: lib: Stay ASCII-compatible for toupper_m/tolower_m X-Git-Tag: tevent-0.12.0~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4171736339bdff4a18b2be016415b8f87b6f383d;p=thirdparty%2Fsamba.git lib: Stay ASCII-compatible for toupper_m/tolower_m 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 Reviewed-by: Alexander Bokovoy Reviewed-by: Andreas Schneider Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Apr 4 11:45:24 UTC 2022 on sn-devel-184 --- diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c index 3f380b9fed6..c35241e2983 100644 --- a/lib/util/charset/codepoints.c +++ b/lib/util/charset/codepoints.c @@ -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; }