Having finally become fed up with "cat *.md5 | md5sum -c" enough to do something about it, I edited md5sum to allow "md5sum -c *.md5". sha1sum is also affected by way of using the same code.

The patch is against 5.2.1 rather than CVS as I couldn't get it to compile properly (autoconf version problems), but with only 7 lines taken out and 9 added in it shouldn't be too hard to apply manually :)

    -- Shish
--- coreutils-5.2.1-orig/src/md5sum.c	2004-01-21 22:27:02.000000000 +0000
+++ coreutils-5.2.1/src/md5sum.c	2005-07-03 19:57:16.000000000 +0100
@@ -663,15 +663,17 @@
     }
   else if (do_check)
     {
-      if (optind + 1 < argc)
+      if(optind == argc)
 	{
-	  error (0, 0,
-		 _("only one argument may be specified when using --check"));
-	  usage (EXIT_FAILURE);
+	  err = digest_check ("-", DIGEST_STREAM (algorithm));
+        }
+      else
+        {
+	  while(optind < argc)
+	    {
+              err |= digest_check (argv[optind++], DIGEST_STREAM (algorithm));
+	    }
 	}
-
-      err = digest_check ((optind == argc) ? "-" : argv[optind],
-			  DIGEST_STREAM (algorithm));
     }
   else
     {
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to