From: Paul Eggert Date: Sat, 28 Oct 2023 16:07:14 +0000 (-0700) Subject: maint: port to oddball tolower X-Git-Tag: v9.5~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5602342a16e81be25ec00b12af847fc0c72f6589;p=thirdparty%2Fcoreutils.git maint: port to oddball tolower * src/digest.c (hex_equal): Work even in oddball locales where tolower does not work as expected on ASCII letters. --- diff --git a/src/digest.c b/src/digest.c index 336392608a..052fa4db71 100644 --- a/src/digest.c +++ b/src/digest.c @@ -18,7 +18,6 @@ #include -#include #include #include @@ -1122,9 +1121,9 @@ hex_equal (unsigned char const *hex_digest, unsigned char const *bin_buffer) size_t cnt; for (cnt = 0; cnt < digest_bin_bytes; ++cnt) { - if (tolower (hex_digest[2 * cnt]) + if (c_tolower (hex_digest[2 * cnt]) != bin2hex[bin_buffer[cnt] >> 4] - || (tolower (hex_digest[2 * cnt + 1]) + || (c_tolower (hex_digest[2 * cnt + 1]) != (bin2hex[bin_buffer[cnt] & 0xf]))) break; }