From abdfde6ba63622c7d0fb9b42b7f38e40ba5619b2 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 3 Apr 2024 13:29:42 +0100 Subject: md5/shaXsum: accept uppercase hex strings The coreutils versions of md5sum and the like accept uppercase hex strings from checksum files specified with the '-c' option. Use a case-insensitive comparison so BusyBox does the same. (GitHub issue #394) --- coreutils/md5_sha1_sum.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index f6a21237d..15f2c04de 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c @@ -320,7 +320,11 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv) hash_value = hash_file(in_buf, filename_ptr, sha3_width); +#if ENABLE_PLATFORM_MINGW32 + if (hash_value && (strcasecmp((char*)hash_value, line) == 0)) { +#else if (hash_value && (strcmp((char*)hash_value, line) == 0)) { +#endif if (!(flags & FLAG_SILENT)) printf("%s: OK\n", filename_ptr); } else { -- cgit v1.2.3-55-g6feb