Blame SOURCES/diffutils-cmp-s-empty.patch

e3c3c2
diff -up diffutils-2.8.1/src/cmp.c.cmp-s-empty diffutils-2.8.1/src/cmp.c
e3c3c2
--- diffutils-2.8.1/src/cmp.c.cmp-s-empty	2002-04-05 21:37:31.000000000 +0100
e3c3c2
+++ diffutils-2.8.1/src/cmp.c	2010-06-25 14:56:08.464802321 +0100
e3c3c2
@@ -316,12 +316,15 @@ main (int argc, char **argv)
e3c3c2
 
e3c3c2
   /* If only a return code is needed,
e3c3c2
      and if both input descriptors are associated with plain files,
e3c3c2
+     and if both files are larger than 0 bytes (procfs files are always 0),
e3c3c2
      conclude that the files differ if they have different sizes
e3c3c2
      and if more bytes will be compared than are in the smaller file.  */
e3c3c2
 
e3c3c2
   if (comparison_type == type_status
e3c3c2
       && S_ISREG (stat_buf[0].st_mode)
e3c3c2
-      && S_ISREG (stat_buf[1].st_mode))
e3c3c2
+      && S_ISREG (stat_buf[1].st_mode)
e3c3c2
+      && stat_buf[0].st_size > 0
e3c3c2
+      && stat_buf[1].st_size > 0)
e3c3c2
     {
e3c3c2
       off_t s0 = stat_buf[0].st_size - file_position (0);
e3c3c2
       off_t s1 = stat_buf[1].st_size - file_position (1);