summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-08-18 18:12:47 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-08-18 18:12:47 +0000
commit47c8512a6ff9a6df52f6848ff7881e5c55b719c2 (patch)
treeb2ab257e80e2eec5f5234e39d6b97c4cee7c6894 /src
parent16901dd5fb98e5348d22e29060795a8b301dcd87 (diff)
downloadcoreutils-47c8512a6ff9a6df52f6848ff7881e5c55b719c2.tar.xz
* src/system.h (select_plural): Reduce by 1000000, not 1000, since
the CVS gettext manual now suggests 1000000.
Diffstat (limited to 'src')
-rw-r--r--src/system.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/system.h b/src/system.h
index 3f6aed6d2..b9c8ee2f9 100644
--- a/src/system.h
+++ b/src/system.h
@@ -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)