From add759429f58e27aef3963370522049bc88dcb47 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 10 2020 11:41:50 +0000 Subject: Apply patch diffutils-cmp-s-empty.patch patch_name: diffutils-cmp-s-empty.patch present_in_specfile: true --- diff --git a/src/cmp.c b/src/cmp.c index bc39153..431b4c6 100644 --- a/src/cmp.c +++ b/src/cmp.c @@ -330,12 +330,15 @@ main (int argc, char **argv) /* If only a return code is needed, and if both input descriptors are associated with plain files, + and if both files are larger than 0 bytes (procfs files are always 0), conclude that the files differ if they have different sizes and if more bytes will be compared than are in the smaller file. */ if (comparison_type == type_status && S_ISREG (stat_buf[0].st_mode) - && S_ISREG (stat_buf[1].st_mode)) + && S_ISREG (stat_buf[1].st_mode) + && stat_buf[0].st_size > 0 + && stat_buf[1].st_size > 0) { off_t s0 = stat_buf[0].st_size - file_position (0); off_t s1 = stat_buf[1].st_size - file_position (1);