summaryrefslogtreecommitdiff
path: root/src/digest.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2021-09-16 11:40:51 +0100
committerPádraig Brady <P@draigBrady.com>2021-09-16 12:20:24 +0100
commit73f8fd760d4c5e63e6290c65092063e855e68626 (patch)
tree6ea2117773bea6a5dde5454a7a4c086888223c24 /src/digest.c
parent121f74dfc2e060a2ae174a636cd773f4d461a852 (diff)
downloadcoreutils-73f8fd760d4c5e63e6290c65092063e855e68626.tar.gz
cksum: fix --check with non tagged format checksums
* src/digest.c: Always set the digest_length, so that we check the correct number of hex digits when parsing non tagged format checksums. * tests/misc/cksum-a.sh: Add a test case. Also fix up this test which was ineffective due to fail=1 being set in a subshell and ignored.
Diffstat (limited to 'src/digest.c')
-rw-r--r--src/digest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/digest.c b/src/digest.c
index fdf01b21b..9ee37a104 100644
--- a/src/digest.c
+++ b/src/digest.c
@@ -1370,7 +1370,7 @@ main (int argc, char **argv)
quote (DIGEST_TYPE_STRING),
BLAKE2B_MAX_LEN * 8);
}
- if (digest_length == 0 && ! do_check)
+ if (digest_length == 0)
{
# if HASH_ALGO_BLAKE2
digest_length = BLAKE2B_MAX_LEN * 8;