From b96f5ea4925854db9eae61f98a7ec44568ecae7d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 16 Aug 2006 19:36:46 +0000 Subject: Fix bugs when printing plurals of numbers that are not unsigned long int values. * src/system.h (select_plural): New function. * src/md5sum.c (digest_check): Use select_plural to avoid bug. * src/uptime.c (print_uptime): Likewise. * src/dd.c (print_stats): Likewise. Also, don't use ngettext to print a floating point number, as reducing to 0 or 1 doesn't work for some languages. Instead, just use "s" for seconds since it doesn't need a plural form. --- src/uptime.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/uptime.c') diff --git a/src/uptime.c b/src/uptime.c index da8618e28..bd2b0ec95 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -125,7 +125,8 @@ print_uptime (size_t n, const STRUCT_UTMP *this) else { if (0 < updays) - printf (ngettext ("%ld day", "%ld days", updays), updays); + printf (ngettext ("%ld day", "%ld days", select_plural (updays)), + updays); printf (" %2d:%02d, ", uphours, upmins); } printf (ngettext ("%lu user", "%lu users", entries), -- cgit v1.2.3-54-g00ecf