bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locate: Negative compression-ratios.


From: James Youngman
Subject: Re: Locate: Negative compression-ratios.
Date: Sun, 2 Jan 2005 10:04:41 +0000
User-agent: Mutt/1.3.28i

On Sat, Dec 25, 2004 at 09:29:21PM +0100, Bas van Gompel wrote:
> Hi,
> 
> Currently, negative compression-ratios are displayed as huge numbers

Nasty.   How did you achieve a negative compression ratio though?

> Following patch fixes it.

I was a bit concerned about the cast to int in your patch, so I have
installed the patch below instead.
> 
> BTW: How do you manage the ChangeLog? I don't see anything recent in
> there.

I periodically use "vc-update-change-log" in Emacs.  It automatically
generates the ChangeLog from the CVS checkin comments.  That means the
ChangeLog is always up to date in release tarballs, and at other times
might be or might not be up to date, and will often lag by a dozen or
so checkin comments.  Is this a significant problem?

James.

Here's the patch:

Index: locate.c
===================================================================
RCS file: /cvsroot/findutils/findutils/locate/locate.c,v
retrieving revision 1.29
diff -u -r1.29 locate.c
--- locate.c    23 Dec 2004 10:46:54 -0000      1.29
+++ locate.c    2 Jan 2005 10:01:04 -0000
@@ -658,7 +658,8 @@
                             hbuf, human_ceiling, 1, 1));

       printf(_("Compression ratio %4.2f%%\n"),
-            100.0 * (double)(statistics.total_filename_length - st.st_size)
+            100.0 * ((double)statistics.total_filename_length
+                     - (double) st.st_size)
             / (double) statistics.total_filename_length);
       printf("\n");
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]