diff options
author | Ron Yorston <rmy@pobox.com> | 2024-04-03 13:59:25 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-07-11 18:17:31 +0200 |
commit | a3c50683069c797ef328f6e32c6282d5d3243c98 (patch) | |
tree | 3f6e02c9ff978a7df3812370502322f584343173 | |
parent | 05e5d6a38157cabc733fc30acf3646a099cf139c (diff) | |
download | busybox-w32-a3c50683069c797ef328f6e32c6282d5d3243c98.tar.gz busybox-w32-a3c50683069c797ef328f6e32c6282d5d3243c98.tar.bz2 busybox-w32-a3c50683069c797ef328f6e32c6282d5d3243c98.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.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/md5_sha1_sum.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index f6a21237d..978d328f1 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c | |||
@@ -320,7 +320,7 @@ 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 (hash_value && (strcmp((char*)hash_value, line) == 0)) { | 323 | if (hash_value && (strcasecmp((char*)hash_value, line) == 0)) { |
324 | if (!(flags & FLAG_SILENT)) | 324 | if (!(flags & FLAG_SILENT)) |
325 | printf("%s: OK\n", filename_ptr); | 325 | printf("%s: OK\n", filename_ptr); |
326 | } else { | 326 | } else { |