]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* src/system.h (select_plural): Reduce by 1000000, not 1000, since
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Aug 2006 18:12:47 +0000 (18:12 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 18 Aug 2006 18:12:47 +0000 (18:12 +0000)
the CVS gettext manual now suggests 1000000.

src/system.h

index 3f6aed6d2a9bda9a300f32f18d5710d6db7725c2..b9c8ee2f9811f23248e35a7f9513f572127d00b4 100644 (file)
@@ -388,7 +388,10 @@ static inline unsigned char to_uchar (char ch) { return ch; }
 static inline unsigned long int
 select_plural (uintmax_t n)
 {
-  return (n <= ULONG_MAX ? n : n % 1000 + 1000);
+  /* Reduce by a power of ten, but keep it away from zero.  The
+     gettext manual says 1000000 should be safe.  */
+  enum { PLURAL_REDUCER = 1000000 };
+  return (n <= ULONG_MAX ? n : n % PLURAL_REDUCER + PLURAL_REDUCER);
 }
 
 #define STREQ(a, b) (strcmp ((a), (b)) == 0)