aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-04-03 13:29:42 +0100
committerRon Yorston <rmy@pobox.com>2024-04-03 13:40:21 +0100
commitabdfde6ba63622c7d0fb9b42b7f38e40ba5619b2 (patch)
treed5074f1f5d598f62e63f8316156f0cf5de7c5f79
parentd83942876e089a63526b9624c74407cdefd6b4ac (diff)
downloadbusybox-w32-abdfde6ba63622c7d0fb9b42b7f38e40ba5619b2.tar.gz
busybox-w32-abdfde6ba63622c7d0fb9b42b7f38e40ba5619b2.tar.bz2
busybox-w32-abdfde6ba63622c7d0fb9b42b7f38e40ba5619b2.zip
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)
-rw-r--r--coreutils/md5_sha1_sum.c4
1 files changed, 4 insertions, 0 deletions
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)
320 320
321 hash_value = hash_file(in_buf, filename_ptr, sha3_width); 321 hash_value = hash_file(in_buf, filename_ptr, sha3_width);
322 322
323#if ENABLE_PLATFORM_MINGW32
324 if (hash_value && (strcasecmp((char*)hash_value, line) == 0)) {
325#else
323 if (hash_value && (strcmp((char*)hash_value, line) == 0)) { 326 if (hash_value && (strcmp((char*)hash_value, line) == 0)) {
327#endif
324 if (!(flags & FLAG_SILENT)) 328 if (!(flags & FLAG_SILENT))
325 printf("%s: OK\n", filename_ptr); 329 printf("%s: OK\n", filename_ptr);
326 } else { 330 } else {