Subject: bug#69368: [PATCH] Allow --zero with --check

From: Ricardo Branco <[email-masked]>
Date: Sat, 24 Feb 2024 20:07:19 +0100

The --zero option is useless if not supported by --check.

Attached patch fixes it.

https://github.com/coreutils/coreutils/pull/81

Best,

R
diff --git a/src/digest.c b/src/digest.c
index e8d5ded33..ddd816012 100644
--- a/src/digest.c
+++ b/src/digest.c
@@ -1178,7 +1177,7 @@ digest_check (char const *checkfile_name)
         error (EXIT_FAILURE, 0, _("%s: too many checksum lines"),
                quotef (checkfile_name));
 
-      line_length = getline (&line, &line_chars_allocated, checkfile_stream);
+      line_length = getdelim (&line,  &line_chars_allocated, digest_delim, checkfile_stream);
       if (line_length <= 0)
         break;
 
@@ -1533,12 +1532,6 @@ main (int argc, char **argv)
      usage (EXIT_FAILURE);
    }
 
-  if (digest_delim != '\n' && do_check)
-    {
-      error (0, 0, _("the --zero option is not supported when "
-                     "verifying checksums"));
-      usage (EXIT_FAILURE);
-    }
 #if !HASH_ALGO_CKSUM
   if (prefix_tag && do_check)
     {