coreutils
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]