diff -adNru dpkg-1.10.25/utils/md5sum.c dpkg-1.10.25md5patch/utils/md5sum.c
--- dpkg-1.10.25/utils/md5sum.c	2004-11-11 20:10:04.000000000 +0000
+++ dpkg-1.10.25md5patch/utils/md5sum.c	2004-12-21 10:35:52.000000000 +0000
@@ -20,6 +20,10 @@
 #include <stdlib.h>
 #include <string.h>
 #include <getopt.h>
+#if HAVE_SYS_STAT_H
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
 #include <unistd.h>
 
 /* Take care of NLS matters.  */
@@ -156,12 +160,21 @@
 {
 	jmp_buf ejbuf;
 	FILE *fp = NULL;
+#if HAVE_SYS_STAT_H
+	struct stat buf;
+#endif
 
 	if (setjmp(ejbuf)) {
 		error_unwind(ehflag_bombout);
 		return 1;
 	}
 	push_error_handler(&ejbuf, print_md5sum_error, arg);
+#if HAVE_SYS_STAT_H
+	if (stat(arg, &buf) != 0)
+		return 2;
+	if (S_ISDIR(buf.st_mode) != 0)
+		return 4;
+#endif
 	if (bin_mode)
 		fp = fopen(arg, FOPRBIN);
 	else
@@ -296,6 +309,10 @@
 				fprintf(stderr, _("%s: error reading %s\n"), progname, filename);
 				ex = 2;
 				continue;
+			case 4:
+				fprintf(stderr, _("%s: %s is a directory\n"), progname, filename);
+				ex = 2;
+				continue;
 		}
 		if (memcmp(chk_digest, file_digest, 32) != 0) {
 			if (verbose)
