[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/8] digest: add LENGTH parameter to digest to support cksum
From: |
Pádraig Brady |
Subject: |
[PATCH 2/8] digest: add LENGTH parameter to digest to support cksum |
Date: |
Tue, 7 Sep 2021 16:45:25 +0100 |
* src/digest.c (digest_file): Add a LENGTH param,
to support cksum(1), and sum(1) which output the
length as part of their output.
---
src/digest.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/digest.c b/src/digest.c
index e2071cfd2..97804de0f 100644
--- a/src/digest.c
+++ b/src/digest.c
@@ -589,7 +589,7 @@ print_filename (char const *file, bool escape)
static bool
digest_file (char const *filename, int *binary, unsigned char *bin_result,
- bool *missing)
+ bool *missing, uintmax_t* length _GL_UNUSED)
{
FILE *fp;
int err;
@@ -737,7 +737,7 @@ digest_check (char const *checkfile_name)
properly_formatted_lines = true;
- ok = digest_file (filename, &binary, bin_buffer, &missing);
+ ok = digest_file (filename, &binary, bin_buffer, &missing, NULL);
if (!ok)
{
@@ -1049,7 +1049,7 @@ main (int argc, char **argv)
int file_is_binary = binary;
bool missing;
- if (! digest_file (file, &file_is_binary, bin_buffer, &missing))
+ if (! digest_file (file, &file_is_binary, bin_buffer, &missing,
NULL))
ok = false;
else
{
--
2.26.2
- Add support for cksum --algorithm [sm3], Pádraig Brady, 2021/09/07
- [PATCH 1/8] maint: rename md5sum.c to more general digest.c, Pádraig Brady, 2021/09/07
- [PATCH 4/8] sum: handle EOVERFLOW for too large inputs, Pádraig Brady, 2021/09/07
- [PATCH 2/8] digest: add LENGTH parameter to digest to support cksum,
Pádraig Brady <=
- [PATCH 5/8] cksum: add --debug to --help output and man page, Pádraig Brady, 2021/09/07
- [PATCH 3/8] digest: refactor sum(1) into digest.c, Pádraig Brady, 2021/09/07
- [PATCH 8/8] digest: add support for sm3, Pádraig Brady, 2021/09/07
- [PATCH 6/8] digest: refactor cksum(1) into digest.c, Pádraig Brady, 2021/09/07
- [PATCH 7/8] cksum: add --algorithm option to select digest mode, Pádraig Brady, 2021/09/07