rpms/diffutils/F-13 diffutils-cmp-s-empty.patch, NONE, 1.1 diffutils.spec, 1.34, 1.35

Tim Waugh twaugh at fedoraproject.org
Fri Jun 25 14:17:51 UTC 2010


Author: twaugh

Update of /cvs/pkgs/rpms/diffutils/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv29156

Modified Files:
	diffutils.spec 
Added Files:
	diffutils-cmp-s-empty.patch 
Log Message:
* Fri Jun 25 2010 Tim Waugh <twaugh at redhat.com> 2.8.1-29
- For 'cmp -s', compare file sizes only if both non-zero (bug #563618).


diffutils-cmp-s-empty.patch:
 cmp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- NEW FILE diffutils-cmp-s-empty.patch ---
diff -up diffutils-2.8.1/src/cmp.c.cmp-s-empty diffutils-2.8.1/src/cmp.c
--- diffutils-2.8.1/src/cmp.c.cmp-s-empty	2002-04-05 21:37:31.000000000 +0100
+++ diffutils-2.8.1/src/cmp.c	2010-06-25 14:56:08.464802321 +0100
@@ -316,12 +316,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);


Index: diffutils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/diffutils/F-13/diffutils.spec,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -p -r1.34 -r1.35
--- diffutils.spec	21 Apr 2010 10:23:50 -0000	1.34
+++ diffutils.spec	25 Jun 2010 14:17:51 -0000	1.35
@@ -1,7 +1,7 @@
 Summary: A GNU collection of diff utilities
 Name: diffutils
 Version: 2.8.1
-Release: 28%{?dist}
+Release: 29%{?dist}
 Group: Applications/Text
 URL: http://www.gnu.org/software/diffutils/diffutils.html
 Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.gz
@@ -9,6 +9,7 @@ Patch0: diffutils-2.8.4-i18n.patch
 Patch1: diffutils-2.8.1-badc.patch
 Patch2: diffutils-sdiff.patch
 Patch3: diffutils-sdiff-E.patch
+Patch4: diffutils-cmp-s-empty.patch
 License: GPLv2+
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
@@ -42,6 +43,9 @@ Install diffutils if you need to compare
 # Fixed 'sdiff -E' (bug #484892).
 %patch3 -p1 -b .sdiff-E
 
+# For 'cmp -s', compare file sizes only if both non-zero (bug #563618).
+%patch4 -p1 -b .cmp-s-empty
+
 %build
 %configure
 make PR_PROGRAM=%{_bindir}/pr
@@ -76,6 +80,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_infodir}/diff.info*gz
 
 %changelog
+* Fri Jun 25 2010 Tim Waugh <twaugh at redhat.com> 2.8.1-29
+- For 'cmp -s', compare file sizes only if both non-zero (bug #563618).
+
 * Wed Apr 21 2010 Tim Waugh <twaugh at redhat.com> - 2.8.1-28
 - Build requires help2man (bug #577325).  Fixes empty diff man page.
 



More information about the scm-commits mailing list